Hi,
Hi Paul,
const osg::MatrixList& m = node->getWorldMatrices();
osg::ComputeBoundsVisitor cbv;
node->accept( cbv );
osg::BoundingBox bb = cbv.getBoundingBox();
osg::Vec3 minV = bb._min * m.front();
osg::Vec3 maxV = bb._max * m.front();
osg::notify( osg::ALWAYS ) << minV << std::endl << maxV <<
std::endl;
This method does not result in an AABB if the matrix contained a
rotation. The bounding box is no longer axis-aligned.
My previous post addresses exactly this problem in efficient way.
You need to do as the OP suggested, transform the 8 corners of the box
and then rebuild an AABB from those. Though I think the code could be
simplified and cleaned up.
J-S
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org