[osg-users] Collision of Spheres

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Wed Sep 3 05:56:42 PDT 2008

Hello Vijay,

> I expect the bounding sphere to coincide with actual spherical object,

I haven't looked at the code specifically, but I think this is the 
assumption which turns out to be false. The Drawables have bounding 
boxes, and then the Geodes containing them have bounding spheres which 
are built to encompass the Drawables' bounding boxes. Hence, the Geode's 
bounding sphere will be larger than the original sphere because it has 
to encompass the sphere's bounding box, which has to encompass the 
sphere itself.

I hope this makes sense. If not, draw it on a piece of paper: draw a 
circle (which is your graphical object), then draw the smallest box that 
encompasses this circle, and then draw the smallest circle that 
encompasses that box. The second circle will inevitably be larger than 
the first one.

It's also pretty easy to make a visitor that will add a graphical 
representation of all bounding volumes of a scene.

Hope this helps,

Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com

More information about the osg-users mailing list