I'm using Irrlicht for a professionnal project, and so far, it worked nicely. But then I implemented something that highlight the selected scene node by drawing a bounding box around it. The "selected" object is the object that the camera is looking at.
My big problem is that :
If I look the object with my camera on the left part of the object, I got this :
And if I look with my camera on the right of the object, I have this :
Obviously, you see that there is a problem with the green and the red bouding box, they are not at the same position :
* The green bouding box is the object's TransformedBoundingBox
* The red bouding bx is the object's BoudingBox
In the first case, the green bouding box is always connected to the object on an edge, and the red bouding box is the inital position of the box.
In the second case, the red bounding box is always on the object, and the green bouding box seems to be at 2*coords, wheree coords are the coordinates I've put the object.
I say "inital position of the box" because I've done a node->setPosition(...) to move it and see what the bounding box are. And yes, I've done a node->updateAbsolutePosition().
The code that shows the bounding boxes is :
Code: Select all
driver->draw3DBox(scene3D->getCurTargetedNode()->getTransformedBoundingBox(), SColor(255,0,255,0));
driver->draw3DBox(scene3D->getCurShowedVarsNode()->getBoundingBox(), SColor(255,255,0,0));
BTW, I'm using the FPS native camera.
I can't give you the entire code because it's fully linked with another software (as I said, I'm working on a professionnal project) and it can't run on its own.
I hope I've been clear enought, and you'll be able to help me,
Don't hesitate to ask for further details,
Thanks