I´ve been playing around with Irrlicht for couple of weeks now, and there is something that seems odd. When I draw a bounding box for a node
Code: Select all
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
core::matrix4() m;
m.setTranslation(node->getPosition());
driver->setTransform(video::ETS_WORLD, m);
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
core::matrix4() m;
m.setTranslation(node->getPosition());
driver->setTransform(video::ETS_WORLD, m);
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
core::matrix4() m;
m.setTranslation(node->getPosition());
m.setRotationDegrees(node->getRotation()); // <----
driver->setTransform(video::ETS_WORLD, m);
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
core::matrix4() m;
m.setTranslation(node->getPosition());
m.setRotationDegrees(node->getRotation());
m.setScale(node->getScale());
driver->setTransform(video::ETS_WORLD, m);
driver->draw3DBox(node->getBoundingBox(), SColor(255, 255, 255, 255));
Code: Select all
driver->setTransform(video::ETS_WORLD, core::matrix4()); // identity matrix
Well for me, transformedBoundingBox was the answer, and fixed the exact same problem you initially described.luvcraft wrote:so I did the transformedboundingbox thing, and I still have the exact same problem -- the box will be attached to the most-recently-created node that's visible -- except NOW, the box floats way off behind and below whichever node it's attached to, which makes it even less useful.
Also, for some reason, the box is brown, regardless of what color I tell it to be.