Set material on shape

cafeole

25-03-2010 10:44:45

Hi, I want to set a material on a capsule to see it in Ogre. My problem is that I don't know how to create a materialIdentifier to, for example, create simply red capsules. How could I do it?

NxOgre::Capsule *cap = new NxOgre::Capsule(radius,longitud);
cap->setMaterial(...);


Thanks :)

betajaen

25-03-2010 10:47:38

This is BloodyMess right?

Create the Material in Scene (Scene::createMaterial), then get the ID from that and give it to the Shape/ShapeDescription.

cafeole

25-03-2010 11:08:05

Thanks for answer betajaen :) yes, this is BloodyMess.

Remember that actors aren't visible until you turn on the debug renderer or use the remote debugger.
There is also a handy tool called the debug renderer. You can use it to make actors visible. Just write:
mNxWorld->createDebugRenderer(mSceneMgr);


Sorry! I have just read it and I have understood my problem. So, mWorld haven't createDebugRenderer method...how could I do it?

betajaen

25-03-2010 12:23:44

It's World::getVisualDebugger then VisualDebugger::setRenderable. NxOgre is non-rendersystem specific now so you have to give it an Ogre Renderable.

Spacegaier's tutorial tells you exactly how to do it: http://www.ogre3d.org/wiki/index.php/Bl ... alDebugger

cafeole

25-03-2010 14:21:48

I had already read it but I did the tutorial and Visual Debugger didn't work. In the tutorial there is a note:

Note: If you are using NxOgre BloodyMess version 1.5.5, the visual debugger has been disabled.

I'm using BloodyMess so...there is any option to work with it?

betajaen

25-03-2010 14:54:43

Upgrade to Detritus where everything is new and shiny. ;)