Hi Daniele, Alberto,
Assuming that no transformation nodes exist in the graph describing your
node, you can write a node visitor that joins all the bounding boxes of
every geode.
Else you'll need to modify every bounding box by its parent transforms
in order to join them.
Actually you don't need to write this, it's so common that it exists in
OSG already: osg::ComputeBoundsVisitor. And it does the right thing with
transforms.
osg::ComputeBoundsVisitor cbbv;
node->accept(cbbv);
osg::BoundingBox bb = cbbv.getBoundingBox();
osg::Vec3 size = bb._max - bb._min;
// Then size contains the size in X, Y and Z.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org