Re: Recomputation of bounding box

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Thu, 05 Nov 1998 17:37:30 -0800


Roni Kass wrote:
>
> Hi Performers,
>
> I changed the vertices position by working directly on the coords of a
> geoset.
>
> In order to get a big enough bounding sphere of the relevent PfGeoD, I
> need
> to have it recomputed or even set it myself.
>
> I tried to setBound the pfGeoD in creation time with the a big enough
> sphere
> and it didn't solve my problem.
>
> 1) Is there a way to set the bounding sphere to my value and keep it ?
>
> 2) Is there a way that I can force a Pfnode to recompute its bounding
> sphere
> even if none of its childern nodes change ?

There are two distinct problems, first, your bounding box musn't change
after you set it, second, any animated children must either not cull or
have their bounds updated with the animation.

When you set bounds you could choose STATIC, not DYNAMIC behaviour,
unless you are animating stuff like DCS nodes below.
For the node below that you could turn off culling traversal by
setting a trivial accept cull result in the pre cull callback.
See the cullResult method.

pfNode <<< STATIC bound sphere
|
pfNode <<< trivial accept cull callback
|
pfEverythingElse

You can force a node to compute it's bounds by calling setBounds
with a NULL pfSphere. The trick is to ensure it has a chance
at the right answer. One simple solution to your whole problem is
to keep all bounds DYNAMIC in the scene graph and after you animate
the geoset call the geoset setBound method with a NULL box after
the update. This will recompute the bounds and cause the whole
tree to be updated. Probably not your fastest option.

Cheers,Angus.

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Nov 05 1998 - 17:37:35 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.