Hi Paul,
Ah. The OP didn't specify "axis-aligned" in the initial post (or if it was
mentioned, I somehow missed it... Either way) my apologies.
Well, osg::BoundingBox is axis-aligned (xmin, xmax, ymin, ymax, zmin,
zmax) so I assumed. You didn't assume, which ultimately is better... :-)
The task appears to be under-specified. You need to answer this question: Do
you want something fast and (possibly) inaccurate, or do you want accurate?
The fast method would be to compute the eight corners, transform them, and
create a new BB that contains the eight transformed points.
The accurate way would be to transform all the coordinates that comprise the
geometry and build a BB that contains them all.
Thanks Paul, good info.
What does OSG do when culling? I guess it considers the object-space
AABB with the camera frustum transformed to object space instead of
always transforming the object-space AABBs to world space (since that's
inaccurate)... Is that right?
I do a similar thing when raytracing: I transform the ray into object
space before checking for intersections, instead of having to transform
the geometry into world space and testing against the world space ray.
So depending on the OP's requirements, perhaps a more efficient and
accurate method would be to use a visitor to visit the scene graph and
do whatever tests they want to do in object space instead of having to
calculate the world-space AABB.
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