From: Stacey Peterson (stacep++at++sgi.com)
Date: 07/29/2004 19:54:38
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
Allan Schaffer wrote:
> Hi John,
>
> I think you're correct. I tried a few scaled variants of esprit.pfb --
>
> esprit.pfb Radius = 3.133899
> esprit.pfb.1,1,0.01.scale Radius = 3.133899
> esprit.pfb.1,1,0.01.scale.1,1,100.scale Radius = 313.389893
>
> The first case the model looked normal (of course). In the second the model
> was very very flat as expected. In the third case the model looked correct
> but the bounding sphere was 100x normal size.
>
> Doesn't make sense to me, looks like a bug. This will be.. SCR 918816.
>
> Allan
>
> John Kelso wrote:
> > Hi all,
> >
> > I have a file that's the output of a simulation, containing about 2500
> > points. The x and y don't have much of a range as they go across z. We
> > wanted to use the scale pseudo-loader to make the data display something
> > we could actually see.
> >
> > If I run my little bounding program:
> >
> >
> >>dpf-bounds test.pfb 2>/dev/null
> >
> > bounding sphere radius = 78.796997
> > (Performer's pfNode->getSphere returns radius = 78.796997)
> > X: 0.000000 - 0.000100, delta: 0.000100 center: 0.000050
> > Y: 0.000200 - 0.014889, delta: 0.014689 center: 0.007544
> > Z: -35.424000 - 122.169998, delta: 157.593998 center: 43.372999
> >
> > the bounding sphere I calculate is based on a sphere around the data's
> > bounding box. The one reported by Performer is on the next line in
> > parentheses.
> >
> > If I scale it mostly in X I get this:
> >
> >>dpf-bounds test.pfb.1000000,100,1.scale 2>/dev/null
> >
> > bounding sphere radius = 93.297958
> > (Performer's pfNode->getSphere returns radius = 78797000.000000)
> > X: 0.100000 - 100.000000, delta: 99.900000 center: 50.050000
> > Y: 0.020000 - 1.488900, delta: 1.468900 center: 0.754450
> > Z: -35.424000 - 122.169998, delta: 157.593998 center: 43.372999
> >
> > It looks like the radius returned by Performer uses just the X scale
> > value. The data ranges look OK.
> >
> > If I switch the X and Z scales:
> >
> >>dpf-bounds test.pfb.1,100,1000000.scale 2>/dev/null
> >
> > bounding sphere radius = 78797000.000000
> > (Performer's pfNode->getSphere returns radius = 78797000.000000)
> > X: 0.000000 - 0.000100, delta: 0.000100 center: 0.000050
> > Y: 0.020000 - 1.488900, delta: 1.468900 center: 0.754450
> > Z: -35424000.000000 - 122170000.000000, delta: 157594000.000000 center:
> > 43373000.000000
> >
> > Performer returns the same radius, but it's correct.
> >
> > Is this correct behavior for the Performer bounding sphere? Am I just
> > using it wrong? How does this affect culling and other activities that
> > use the bounding sphere? Does perfly use it to size and center the
> > object?
> >
> > I can send the data as a pfb if it'll help.
> >
> > Thanks,
> >
> > -John
> >
> >
> > -----------------------------------------------------------------------
> > List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> > Open Development Project: http://oss.sgi.com/projects/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
> > -----------------------------------------------------------------------
> > SIGGRAPH 2004 Friends of Performer BOF:
> > Tuesday, August 10, 6pm - 8pm Wilshire Grand Hotel, Sierra Ballroom
> > -----------------------------------------------------------------------
>
> --
> Allan Schaffer allan++at++sgi.com
> Engr. Dept. Manager, Visual Systems Group 1-650-933-2160
> Silicon Graphics http://www.sgi.com
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
> SIGGRAPH 2004 Friends of Performer BOF:
> Tuesday, August 10, 6pm - 8pm Wilshire Grand Hotel, Sierra Ballroom
> -----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Thu Jul 29 2004 - 19:55:06 PDT