Re: volume 2 volume intersection

New Message Reply Date view Thread view Subject view Author view

Liu Xiaoyan (liuxy++at++nsrc.nus.sg)
Fri, 20 Feb 1998 19:44:28 +0800


> > I'm doing a simple volume to volume intersection in Performer,
> > a moving pfCylinder built around the bounding sphere of an object
> > and other objects, looks like:
> >
> > // collision detection between one moving target and other static
> > objects
> > pfSegSet segset;
> > pfHit **hits[32];
> > int numHit = 0;
> >
> > pfSphere boundBall; // bounding box of the moving object
> > getBound(&boundBall);
> > pfCylinder *cylinder = new pfCylinder;
> > pfSphere **list = (pfSphere **)pfMalloc(1 * sizeof(pfSphere *),NULL);
> > list[0] = &boundBall;
> > cylinder->around((const pfSphere **)list,1); // cylinder
> >
> > segset.mode = PFTRAV_IS_PATH | PFTRAV_IS_GSET | PFTRAV_IS_BCYL;
> > segset.userData = (void *)NULL;
> > segset.activeMask = 0x0; // or 0xFFFF????
> > segset.isectMask = HITABLE; // Intersection mask
> > segset.bound = (void *)cylinder;
> > segset.discFunc = NULL;
> > numHit = ((this->getParent(0))->getParent(0))->isect(&segset,hits);
> > I'm not sure of the value for segset.activeMask in this case of a
> > cylinder detection. When set as 0xFFFF, always hits detected; If set as 0, always no hit.
> > Neither is correct. What's wrong with my code?
>
> When you do a pfNode::isect() you must at least specify one segment of
> the pfSegSet::segs[i]. The segments you fill in must be marked in
> the pfSegSet::activeMask. Every bit in the mask corresponds with one
> segment in the segs array.

  I've followed the programming guide which says " If only a rough
volume-volume intersection
is required, you can specify a bounding cylinder in the pfSegSet
"without" any line segments at all and request discriminator callbacks
at the PFTRAV_IS_NODE or PFTRAV_IS_GSET level. "
(last page of Ch.6) One point I found is PFTRAV_IS_NODE nonexsitant on
my machine.
  
  My cylinder is not constructed from pfSegSets, it is from the bounding
sphere of an object.

 If I have to define at lease one pfSeg for the moving cylinder, say
segs[0],dose the "dir"
mean the moving direction of the cylinder? and how to define "pos" in
this case? or they
are just meaningless?

  One relative question is the Bounding Sphere of a pfDCS. What is the
coordinate system
used to express the "center , radius", relative to scene root?

Rgds,

Liu

***********************************************************************
Liu Xiaoyan National Supercomputing Research Center
Data Visualization Group http://www.nsrc.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:56:48 PDT

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