From: Paolo Farinelli (paolo++at++sgi.com)
Date: 03/24/2003 18:45:41
Hi Alessandra,
I think your best bet would be to implement your own pfuTraverser, in which
you would test the bounding sphere of each node against the pfFrustum.
This will allow early rejection of portions of the database that lie
completely
outside the frustum.
For each pfGeode that is reached by your traverser, you can then test each
pfGeoSet's bounding box against the frustum, and carry out some sort of
triangle-to-triangle intersection test only on triangles of the geosets that
appear to be at least partially inside frustum.
As an additional optimization, you may want to consider transforming the
frustum instead of transforming the bounding spheres, when travesrsing
nodes under one ore more matrix transformation.
This would involve maintaining a stack of transformed pfFrustums, which
you would push and pop when traversing pfSCS (or derived) nodes.
(see pfFrustum::orthoXform).
Hope this helps. Let me know if you find any flaw in the method I suggested,
or if you want to discuss any detail further.
ciao,
Paolo
acanesi++at++ais.it wrote:
>Hi Performers,
>in my application I would like to use a collision detection algorithm I've
>found in literature that defines a frustum related to the position of a
>virtual tool used to interact with a geometrical model. The perspective
>frustum allows to find out which elements of the model could be
>intersected by the tool (the algorithm has been developed in OpenGL using
>GL_SELECT/GL_FEEDBACK mode), reducing the number of tests required to
>compute exact intersection points.
>I've tried to find a way to do the same thing with Performer but the only
>way I've found is to define a pfFrustum, check if each pfGeoSet bbox of
>the model is inside/outside the frustum and set the intersection mask to
>0xfffffff if the bbox is partially or totally inside the pfFrustum and to
>0x000000 otherwise, before the intersection test occurs.
>Can you please suggest me a better solution? (I'm not so skilled in
>Performer and I'm a bit late with my work!)
>
>Thank you!
>
>Alessandra
>
-- Paolo Farinelli paolo++at++sgi.com Member of Technical Staff, OpenGL Performer 1-650-933-1808 Silicon Graphics 1600 Amphitheatre Pkwy, Mountain View, CA 94043
This archive was generated by hypermail 2b29 : Mon Mar 24 2003 - 18:45:47 PST