Re: pfMakePolarSeg ??

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)
Tue, 25 Mar 1997 10:15:23 -0500


On Mar 24, 9:24am, Tracy Hunt wrote:
> Subject: pfMakePolarSeg ??
> Does anyone have example code on how to use pfMakePolarSeg?
>

Here is one...

#define SEG_LENGTH 10000.0

/* initialize only once */
pfSegSet segset;

segset.mode = PFTRAV_IS_PRIM|PFTRAV_IS_NORM|PFTRAV_IS_CULL_BACK;
  segset.activeMask = 1;
segset.isectMask = 0x1;
segset.bound = NULL;
segset.discFunc = NULL;
...

/* in the run time loop */
pfHit **hits[32];

pfGetChanView(chan, pos, dir);
pfMakePolarSeg(
    &segset.segs[0],
    pos,
    dir[PF_H],
    dir[PF_P],
    SEG_LENGTH);

/* you may have to do this or isect may not work - this could be a pfbug... */
pfGSetIsectMask(gset, 0x1, PFTRAV_SELF, PF_SET);

isect = pfGSetIsectSegs(gset, &segset, hits);
if (isect)
{
   pfVec3 tpoint, vpoint;
   pfMatrix mat;

   pfQueryHit(*hits[0], PFQHIT_POINT, &tpoint);
   pfQueryHit(*hits[0], PFQHIT_XFORM, mat);
   pfXformPt3(vpoint, tpoint, mat);
   or whatever you want to do with the isect result...
}

Hope it helps.

Cheers,
Gan

>
> Tracy Hunt
> hunt++at++gts.elan.af.mil
> =======================================================================
> 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 Tracy Hunt

-- 

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:56 PDT

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