Why shape material not working?

zrixter

05-04-2008 17:35:22

Hi seniors, i'm new to nxogre and i got problem with change the material for shape. I using NxOgre 0.9. Physx SDKs 2.7.3.

my code:
mScene->createBody("cube.1m.smooth.mesh", new CubeShape(1,"material: nx.lava"), Vector3(2), "mass: 10");

According to the tutorials i should able to attach nx.lava material on the cube, but it remain yellow colour in my screen. I double checked the NxOgreShape.h and i make sure the params is correct.

Any idea? Thanks in advanced.

betajaen

05-04-2008 18:22:02

A PhysX/NxOgre material defines the bounce and friction of the shape - not the look.

You have to set the Ogre Material which defines the look normally through Ogre - through an entity.

zrixter

05-04-2008 18:42:57

Oh, i see. Thanks! so i just need to create an entity from mesh, assign material to it, then createbody with the existing entity? i going to try it out, thanks. :oops:

zrixter

05-04-2008 19:05:42

we can't do createbody from an entity or scenenode directly with nxogre 0.9 ?
only [bleeding] nxogre provide that function right?

betajaen

05-04-2008 19:29:01

You can, but NxOgre can do it for you. So there isn't much point.