Ulrich J Lechner (uli++at++vislab.iastate.edu)
Sat, 17 Feb 1996 11:25:46 -0600
I would like to intersect my scene (on PFTRAV_IS_GEODE or PFTRAV_IS_GSET level)
with a simple cylinder or a box. What is the standard way to do this?
I tried to use a pfSegSet without any lines, a bounding cylinder and
a discriminator function (see pguide 186)
Result: My disc function is never called. I guess it is because of a missing
line segment. Did I do something wrong or is there another way to
test any object against a node. Do I have to use pfSphereContainsSphere
to test against every bounding volume for every node?
Uli
> pfNodeTravMask(root, PFTRAV_ISECT, 1, PFTRAV_SELF, PF_SET);
.....
> pfSetVec3(cylinder.center, 0, 0, 0);
> pfSetVec3(cylinder.axis, 0, 0, 1);
> cylinder.halfLength=100;
> cylinder.radius=100;
> segset.activeMask = 1; (or 0)
> segset.isectMask = 0xFFFF;
> segset.discFunc = disc;
> segset.bound = &cylinder;
> segset.mode = PFTRAV_IS_BCYL|PFTRAV_IS_GSET|PFTRAV_IS_GEODE;
.....
> isect = pfNodeIsectSegs(root, &segset, hits);
> int disc(pfHit *hit)
> {
> printf("Intersect\n");
> return(PFTRAV_CONT | PFTRAV_IS_CLIP_END);
> }
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:25 PDT