[osg-users] Boundingsphere precision question

Paul Melis paul at science.uva.nl
Sun Jul 27 07:45:43 PDT 2008


Hi,

Ariasgore wrote:
>> The bounding spheres in OSG are used as loose bounds to be able to 
>> quickly do frustum culling. If you need tight bounds you should be 
>> able to use the getBoundingBox() method on the Geode's of interest. 
>> This method returns a bounding box that should tightly fit around the 
>> geometry data (I haven't checked this, merely assuming it is a tight 
>> fit based on the geometry's vertices).
>
> I created a NodeVisitor and traversed the loaded node, the boundingbox 
> I received from the Geode is indeed smaller, but it confused me a 
> little bit, since it looks like the attached picture -> 
> http://img225.imageshack.us/img225/3594/tankspherexgk9.gif
See the attached picture for the scene graph layout (hope I used the 
same model as you, the original NPS tutorials have been removed it seems).

> So obviously there are several geode in the model, but is there a 
> quick way to get the "overall" geode? I tried to traverse all geodes 
> and saving the geode with the biggest boundingbox radius, but then I 
> get the center of the last goede's center, which is seldomly the 
> center of the model.
You can combine bounding boxes into a single larger one, using 
BoundingBox::expandBy(BoundingBox&) in your node visitor. That should 
give you the overal bbox for all the Geode's in the graph.
A radius doesn't make much sense for a bounding box.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t72-tank_des.flt.jpg
Type: image/jpeg
Size: 175882 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080727/1281692f/attachment-0003.jpg>


More information about the osg-users mailing list