Hi,
I know that this problem has been discussed several times since this forum exists but the most soultions don't work in my case. I want to show the boundingbox around my object but unfortunately when i set showDebugData to true the calculation power my computer needs rises from 10 to 50 percent. So I search for another way to show the bounding box and tried following code...
IAnimatedMeshSceneNode node;
Box3D box = node.TransformedBoundingBox;
device.Video.drawBox3D(box, new Color(200,255,255,255));
unfortunately this box will be never drawn.. what do I wrong?
I use Irrlicht.NET
thanks for your hrlp
Show BoundingBox
Just FYI, I don't believe that all scene nodes implement debug rendering as of 1.3, so you might still want to render the box yourself. Just to expand on what bitplane just said...
Code: Select all
// after driver->beginScene(...)
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
// this is an object aligned bounding box. it should be a pretty tight fit.
core::aabbox3df box(node->getBoundingBox());
// to draw a box that is in object coordinates...
driver->setTransform(video::ETS_WORLD, node->getAbsoluteTransformation());
driver->draw3DBox(box, video::SColor(255, 0, 255, 0));
// this is a world aligned bounding box. it may be bigger than the
// object space bounding box, but the edges of the box will be aligned
// with the world coordinate system.
node->getAbsouteTransformation().transformBoxEx(box);
// to draw a box that is in world coordinates...
driver->setTransform(video::ETS_WORLD, core::matrix4());
driver->draw3DBox(box, video::SColor(255, 0, 0, 255));
// before driver->endScene(...)