uncalled pre-isect callback: solved.

New Message Reply Date view Thread view Subject view Author view

Liu Xiaoyan (liuxy++at++ihpc.nus.edu.sg)
Wed, 06 May 1998 17:45:57 +0800


Thanks, Jeremy, it works now.

>From: jaf++at++chem.ucsd.edu (Jeremy Friesner)
>Organization: Entropiphilic Reorganization Consultants
> To: Liu Xiaoyan <liuxy++at++ihpc.nus.edu.sg>

>Hmm, you might want to review the Performer manuals again, especially
>the parts where they talk about scene graph traversal. They don't
>say too much about the ISECT traversal, but look at the part on the
>CULL traversal (where they show the pictures of the toy airplane/teddy bear/etc)
>. The ISECT traversal works much the same way; that is, the traverser
>doesn't always test every node in the tree; rather, it will try to
>prune its traversal at every node if it can determine that collisions
>with children of that node are impossible. So your
>box2boxHit function only gets called when the dummy vector in your
>segset is within the bounding area of the node's parent.

>The next thing I would try, then, is to set your dummy vector
>to take up part of the space your testing box is in. (Maybe
>have it run from one corner of box1 to the other)

> It looks like:
>
> group->setTravFuncs(PFTRAV_ISECT, box2boxHit, NULL);
> group->setTravData(PFTRAV_ISECT, (void *)shared_ptr);
>
> int box2boxHit(pfTraverser *trav, void *data)
> {
> pfNode *node = trav->getNode();
> printf(" ... info.... "); // sometimes not printed
> if (box1.contains(&box2) != PFIS_FALSE)
> printf("\n *************************MAY HIT");>
> // collision detection between objects, use a dummy line
> // to initiate ISEC traversal, actual detection done in
> // each node's isecCallback.
> pfSegSet segset;
> pfHit **hits[32];
> segset.mode = PFTRAV_IS_GSET;
> segset.userData = (void *)NULL;
> segset.activeMask = 1;
> segset.isectMask = 0xffffffff;
> segset.bound = (void *)NULL;
> segset.discFunc = NULL;
> segset.segs[0].dir.set(0.0f, 0.0f, -1.0f); // dummy vector
> segset.segs[0].length = 1.0f;
> printf("\n ....... begin ......."); // always printed
> (shared_ptr->scene)->isect(&segset, hits); // activate it
>
>

***********************************************************************
Liu Xiaoyan Institute of High Performance Computing
Data Visualisation Group http://www.ihpc.nus.edu.sg Tel:(65)7709267
***********************************************************************
=======================================================================
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:57:22 PDT

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