Re: intersection testing and pfTerrain

New Message Reply Date view Thread view Subject view Author view

Gan Wang (rock.csd.sgi.com!sgi.com!uunet.uu.net!ds9!cavalier!gan)
Mon, 20 Jan 1997 10:46:15 -0500


On Jan 17, 3:52pm, Edward Peters wrote:
> Subject: intersection testing and pfTerrain
> I have a Geode which is a morphset of a pfTerrain node. I set up a segset
and
> hits as follows:
>
> pfSegSet segset;
> pfHit **hits[32];
>
> segset.isectMask = 0x01;
> segset.discFunc = NULL;
> segset.bound = NULL;
> segset.mode = PFTRAV_IS_PRIM;
>
> segset.segs[0].pos.set ((float)x, (float)y, 500.0f);
> segset.segs[0].dir.set (0.0f, 0.0f, -1.0f);
> segset.segs[0].length = 1000;
> segset.activeMask = 1;
>
> Then I do the following (my geode is pfGeode *ground):
>
> int isect = ground->isect(&segset, hits);
>
> if (isect) {
> // intersection, do something
> }
>
> else {
> // you missed, do something else
> }
>
> It fails every time (ie no intersections).

I had a similar experience. A way to get around it is to set the appropriate
nodeTravMask everytime before isect() call is made. The default node/gset mask
does not work for some reason. This may be a Performer bug with morph gset.

> Earlier I had some code (almost
> identical) which would fail sometimes, and work other times.
>
> Does the app and cull processing of the pfTerrain node use intersection
testing
> to determine what's visible and what's not? If so, would it require a reset
of
> the TravMask every frame for other intersection testing to work? I ask
because
> part of the enigma seems to be where my intersections are placed relative to
> the call to pfFrame().
>
> Thanks in advance for your help.
>
>
> Ed Peters
> elpeters++at++ncsa.uiuc.edu
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Edward Peters

-- 

Gan Wang

Cambridge Research Associates Voice: 703-790-0505 ext.7210 1430 Spring Hill Road, Suite 200 Fax: 703-790-0370 McLean, VA 22102 E-mail: gan++at++cambridge.com ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:22 PDT

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