From: Francesco Chionna (francesco.chionna++at++cetma.it)
Date: 12/01/2004 08:09:55
Hi pfs,
i would like to itersect a bounding volume with another that i create with a pfgeode. I don't know if all the steps are correct but it dosn't work.I have read that
"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."
Any suggestion sample ... are welcome!
Best Regards
//I CREATE A CYLINDER
pfCylinder cyl;
cyl.center.vec[0]=0;
cyl.center.vec[1]=0;
cyl.center.vec[2]=0;
cyl.radius=10;
cyl.halfLength=10;
cyl.axis.vec[0]=1;
cyl.axis.vec[1]=0;
cyl.axis.vec[2]=0;
i load a cube in (5,30,3) as pfgeode-pfgset I SET TRAVMASK=1
// I set the segset to &cyl
segset3.activeMask = 0; //is it correct?
segset3.isectMask = 0xFFFF;
segset3.discFunc = NULL;
segset3.bound = &cyl;
segset3.mode = PFTRAV_IS_GEODE||PFTRAV_IS_GSET||PFTRAV_IS_BCYL;
while (!shared->exitFlag)
{
int isect;
int isect1;
isect=0;
//I MOVE THE CYLINDER
cyl.center.vec[0]=xval+0.5; //XVAL=0
cyl.center.vec[1]=30;
cyl.center.vec[2]=3;
// do an intersection test against the scene graph
isect = root->isect(&segset3, hits);
if (isect)
{
}
xval += 0.1f;
}
This archive was generated by hypermail 2b29 : Wed Dec 01 2004 - 08:11:10 PST