Cindy Tonnesen (tonnesen++at++enews.nrl.navy.mil)
Thu, 2 Dec 93 13:39:12 -0500
Problems I'm having: pfSegsIsectNode() is currently always returning 1 - that
one line segment hit something. When by sight, it is obvious that the line
segment was no where near the object.
My code looks like:
...
pfGeode *root;
pfSeg seg;
pfHit **hits[1];
float nodehit;
_pfSegSet segSet;
long numHits;
...
root = LoadIcon("/srvr/icons/70.icon");
pfNodeTravMask(root, PFTRAV_ISECT, 0x01, PFTRAV_SELF |
PFTRAV_DESCEND | PFTRAV_IS_CACHE, PF_SET);
/* I've also tried pfGSetIsectMask() in place of the above line;
* both yield the same results.
*/
...
...
pfMakePtsSeg(&seg, vertics[0], vertices[1]);
segSet.typeId = NULL;
segSet.userData = NULL;
segSet.segs[0] = seg;
// set active mask to 0x01; set 0th bit to 1.
segSet.activeMask = 0x01;
segSet.isectMask = 0x01;
segSet.mode = PFTRAV_IS_GSET | PFTRAV_IS_GEODE | PFTRAV_IS_PRIM;
segSet.bcyl = NULL;
segSet.discFunc = NULL;
/* this function is always returning numHits = 1 */
numHits = pfSegsIsectNode(root, &segSet, hits);
if (numHits)
{
nodehit = 0.0;
pfQueryHit(hits[0][0], PFQHIT_GSET, &nodehit);
if (nodehit != NULL)
{
/* intersection successful */
processing...
}
}
Part of the difficulty in getting this to work is that I only have man pages
as sent with the beta release as documentation, and there are NO examples
in it of using the intersection routines.
Any light anyone can shed on this would be highly appreciated - even if
you do not have the answer to my question, I would *highly* appreciate
some sample code that uses these routines successfully!
Thank you,
Cynthia Tonnesen
Naval Research Lab
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:06 PDT