Torsten Moeller (tmoeller++at++cgrg.ohio-state.edu)
Tue, 27 Feb 1996 18:12:31 -0500
I discovered, that in the file
/usr/src/Performer/src/lib/libpfutil/isect.c
in the function pfuDiscFunc(pfHit *hit)
only the flag PFTRAV_CONT is returned.
That is the case since the discFunc defined in
/usr/src/Performer/src/lib/libpfutil/collide.c
is never called, since it is not passed as a parameter
in the function pfuSegsIsectNode.
Therefore an intersection test is still taking place,
but not necessarily the first (closest) intersection is
returned, but some randomly chosen one.
To get around this problem you need to change these functions either by
including discFunc as a parameter when you call pfuSegsIsectNode or you
need to change pfuDiscFunc so it returns the flags
(PFTRAV_CONT | PFTRAV_IS_CLIP_START)!
I hope this helps,
Torsten.
-- Research Assistant ACCAD tmoeller++at++cgrg.ohio-state.edu Ohio State University
On Feb 13, 11:30, Hilko Hoffmann wrote: > Subject: pfuCollideObj > Performers, > > I want to use pfuCollideObj to detect if the current position is under a > simple polygon. The idea is to fired a ray upwards. See the follwing code > fragment: > > > > static void *sharedArena = NULL; > pfSeg *upray; > > > if (sharedArena == NULL) > sharedArena = pfGetSharedArena(); > > /* Set upray's specifications */ > upray = (pfSeg*) pfMalloc(sizeof(pfSeg), sharedArena); > pfMakePolarSeg(upray, ViewState->viewCoord.xyz, 0.0, 90.0, 3000.0); > > /* Determine if intersection with polygons has occured */ > if (pfuCollideObj(upray, regFog[0].fnode, hit, norm)) > printf("--%f %f %f\n", hit[0], hit[1], hit[2]); > > > > > regFog[0].fnode contains polygon's node. I tested a version with > > if (pfuCollideGrnd(&ViewState->viewCoord, regFog[0].fnode, hit)) > > to be sure that regFog[0].fnode really contains the right node and it works! > > Does anybody know why pfuCollideObj doesn't work? > > Regards, > > Hilko > > -- > Hilko Hoffmann hilko++at++rsl.geogr.unizh.ch > > Phone: +41 - 1 / 257 51 63 Remote Sensing Laboratories > FAX: +41 - 1 / 362 52 27 University of Zurich > Winterthurerstrasse 190 > CH-8057 Zurich; Switzerland > >-- End of excerpt from Hilko Hoffmann
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:27 PDT