Re: [info-performer] picking on a both-sided visible object

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 09/30/2003 18:26:39


Hi Myriam,

I am not sure I understood your problem exactly: Seems like you would
want the isect traverser to intersect with all visible sides of your
geometry,
and ignore all invisible sides.. is this right?

Unfortunately, I don't think there is a straightforward way to do this.
if you set the PFTRAV_IS_CULL_BACK bit, all backfaces are ignored
(even visible ones). If you don't set this bit, then all backfaces are
picked
(even invisible ones)..

You could try to set up a discriminator callback (see man pfNodeIsectSegs).
This callback would be called whenever an intersection occurs.

You would need NOT to set the PFTRAV_IS_CULL_BACK bit in your
mask. In your disc callback, you would want to figure out whether to accept
or reject each intersection, based on whether you have intersected with a
visible face or not.. (ie discard intersection if it is a backface of a
polygon
which is only visible from the front)..

Hope this helps.
Regards,
Paolo

Myriam Lajon wrote:

>I'm trying to pick a both-sided visible object but only one side can be
>picked, no intersection can be made on the other side.
>
>My intersection request uses the bit vector mode PFTRAV_IS_CULL_BACK. If I
>do not use this bit vector, the intersection is possible on both sides. The
>problem is that my application needs the bits vector PFTRAV_IS_CULL_BACK to
>be set.
>
>What can I do to solve my problem?
>
>thanks,
>Myriam
>
>// *** code ***//
> pfSegSet segSet;
> segSet.activeMask = 1;
> segSet.isectMask = 0xFFFFFF;
> segSet.mode = PFTRAV_IS_PRIM | PFTRAV_IS_NORM | PFTRAV_IS_PATH |
>PFTRAV_IS_CULL_BACK;
> segSet.bound = NULL;
> segSet.userData = NULL;
> segSet.discFunc = NULL;
> segSet.segs[ 0 ].length = 500000.0;
>
> isect = pfNodeIsectSegs(myScene, &segSet, hits);
>
>-----------------------------------------------------------------------
> 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
>-----------------------------------------------------------------------
>
>
>
>

-- 
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


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Sep 30 2003 - 18:27:30 PDT