Re: [info-performer] bounding sphere with non-uniform scaling

Date view Thread view Subject view Author view

From: John Kelso (kelso++at++bev.net)
Date: 07/30/2004 08:38:49


Hi,

Your explanation makes sense in light of how the scale pseudo-loader
operates.

Flattening the scenegraph isn't an option for many of our applications as
they rely on named nodes being present, and flattening can eliminate
nodes.

My workaround was to write my own bounding sphere program which generates
a bounding box around a node and then puts a sphere around the box. Time
consuming, I know, but it's the best I could come up with. Luckily it
isn't called every frame, just when loading a file.

Any better suggestions?

Thanks,

-John

On Thu, 29 Jul 2004, Stacey Peterson wrote:

> John,
>
> Thanks for the message. Did a little bit more checking, and this seems to be
> expected behavior. What happens with the scale pseudoloader is it adds an
> SCS node above the geode. When querying for the bounding sphere, the
> SCS queries the geode for its bounding sphere, and then transforms it by the
> scale. Since the SCS doesn't know about the actual geometry of the geode, it
> has to perform a conservative estimate and so multiplies the radius by its
> largest scale value.
>
> The part you care about - there is a solution. The best (and probably
> easiest) solution is to simply flatten your scene graph (look up pfFlatten)
> whenever there are static SCS nodes. This will update the geometry to reflect
> any static transformations, and thus be able to provide a tighter bounds on the
> geometry. To see the flatten in action, try running:
>
> perfly -Q 1 test.pfb.1000000,100,1.scale
>
> Hope this helps.
> Stace


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jul 30 2004 - 09:04:20 PDT