[osg-users] Boundingsphere precision question
paul at science.uva.nl
Sun Jul 27 07:45:43 PDT 2008
>> 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 ->
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 175882 bytes
Desc: not available
More information about the osg-users