Hilko Hoffmann (hilko++at++rsl.geogr.unizh.ch)
Tue, 13 Feb 1996 16:50:28 +0100
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.chPhone: +41 - 1 / 257 51 63 Remote Sensing Laboratories FAX: +41 - 1 / 362 52 27 University of Zurich Winterthurerstrasse 190 CH-8057 Zurich; Switzerland
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:24 PDT