Re: Extracting a named group from a scene graph...
John Rohlf (jrohlf++at++tubes)
Fri, 14 Apr 95 18:50:24 PDT
>
>
> Has anybody ever tried to extract a portion of a scene graph (say,
> all nodes below a named group) and place it under a DCS or SCS?? I've
> been working on this for a while with mixed results. Basically,
> I remove the group node from the scene graph, traverse its children
> down to the geosets and change the vertices so that they are defined
> relative to the extracted objects center - the groups bsphere center
> (making this the objects origin). Then I move the children under the
> new DCS node.
>
> This 'almost' seems to work. I have the object in question spinning
> in place and I can only see it during ~90 degrees of its rotation.
> Even though the isect traversal masks seem to be set, intersection
> (collision and picking) doesn't seem to work.
>
> I also noticed from the scene dump that the vertices have been changed
> but the bsphere center for all nodes seem to be the same as before
> extraction. I've tried setting them all explicitly using:
>
> pfNodeBSphere(node, NULL, PFN_BMODE_DYNAMIC);
>
> Is there something I need to do to explicitly change an object's origin?
> I know I'm missing something here, I'm just not sure what. Any pointers
> or suggestions would be appreciated!
>
pfGeoSets don't know when their coordinates change so their
bounding boxes are not automatically updated and geodes just look
at geoset bounding boxes. Call
pfGSetBBox(gset, NULL);
to force recomputation of the geoset bounding box. Then call
pfNodeBSphere(node, NULL, PFN_BMODE_DYNAMIC);
to force recomputation of the node bounding sphere.
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:51:17 PDT