Re: pfNode isect: technique or bug?

New Message Reply Date view Thread view Subject view Author view

From: 'Bwana' Bob Buckley (Bob.Buckley++at++JNTF.osd.mil)
Date: 11/21/2000 12:59:56


Benedikt Kessler wrote:
>
> Hi!
>
> If I remember well, there must be at least one segment in the cylinder.
> The volume does not replace the segment intersection tests but does
> improve them (as it is mentionned in the manpage):
>
> "When a bounding volume is supplied, the intersection traversal may use
> the cylinder to improve performance. The largest improvement is for
> groups of at least several segments which are closely grouped segments.
> Placing a bounding cylinder around small groups or widely dispersed
> segments can decrease performance."
>
> In detail:
>
> // if the cylinder doesn't intesect the bounding geometry, then prune.
> // else check all segments and do intersection tests.
>
> The cylinder alone will not generate any hit. It will only prevent the
> library to do many unnecessary segment intersection tests if the
> cylinder does not intersect any bounding volume.
>

From the Performer Programming Manual (Insight, second to last paragraph
of Chapter 4):

"If only a 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."

I have modified my test case to include both a cylinder and a single
segment. I point them in different directions to see how the traversal
proceeds and they work properly. The cylinder controls isect callbacks
on nodes and the segment's used for geoset intersects. I only needed the
node callbacks which is why the confusion for volume-volume testing.

Thanks, Benedikt & Angus.

>
> BTW, What is the strange PFTRAV_IS_IS_BCYL constant that you are using;
> If I look at the manpage and the include file I can only find the
> PFTRAV_IS_BCYL constant that should be or-ed in the mode field;
>

Typo on my part. It does compile and run cleanly without the extra
'IS_'.

>
> Bye! Benedikt
>
> 'Bwana' Bob Buckley wrote:
> >
> > Dude!
> >
> > Angus Dorbie wrote:
> > >
> > > Did you set the right querry information on the way in and then querry
> > > hit for the right stuff afterwards?
> > >
> >
> > I place a unit cube at 5m from the origin on the y axis. I then rotate
> > it around the origin in the xy plane at that 5m radius. Using a single
> > seg pointing down the y axis I do get a proper intersect. However, when
> > zeroing out the active mask and enabling the cylinder volume I get no
> > intersects. The cylinder sits exactly on the cubes path at 5m. I place a
> > callback on the scene and it does get called as expected, but apparently
> > the intersect fails and the traversal is truncated at that point. It
> > properly traverses when using that single seg and I test using
> > breakpoints in the callbacks of child nodes.
> >
> > Here's the setup:
> >
> > pfClyinder cylinder;
> > cylinder.center.set(0.0f, 5.0f, 0.0f);
> > cylinder.axis.set (0.0f, 1.0f, 0.0f);
> > cylinder.radius = 1.0f;
> > cylinder.halfLength = 1.0f;
> >
> > pfSegSet segSet;
> > //segSet.activeMask = 0x01;
> > segSet.activeMask = 0x0;
> > segSet.isectMask = 0xffffffff;
> > segSet.userData = NULL;
> > segSet.discFunc = NULL;
> > //segSet.bound = NULL;
> > segSet.bound = (void *) &cylinder;
> > //segSet.mode = PFTRAV_IS_PRIM | PFTRAV_IS_NORM |
> > PFTRAV_IS_CULL_BACK | PFTRAV_IS_IS_BCYL;
> > segSet.mode = PFTRAV_IS_GEODE | PFTRAV_IS_GSET |
> > PFTRAV_IS_IS_BCYL;
> > segSet.segs[0].dir.set(0.0f, 1.0f, 0.0f);
> > segSet.segs[0].pos.set(0.0f, 0.0f, 0.0f);
> > segSet.segs[0].length = 1000.0f;
> >
> > Within the main sim loop I have:
> >
> > pfHit **hits[32];
> > int numHits = scene->isect(&segSet, hits);
> >
> > >
> > > What happens then if you querry down to the tri information? Do you get
> > > the bounds hit info?
> > >
> >
> > It never traverses beyond the scene using strictly the volume test.
> >
> > >
> > > You aren't expecting *coordinate* information for the bounds hit querry
> > > are you?
> > >
> >
> > Right now I'm just trying to get a non-zero hit count on the isect using
> > volumes. Actually, just trying to get it to traverse beyond the scene
> > node.
> >
> > >
> > > P.S. if I told you the Performer handshake it wouldn't be a secret.
> > >
> >
> > :)
> >
> > >
> > > Cheers,Angus.
> > >
> > > 'Bwana' Bob Buckley wrote:
> > > >
> > > > I've been trying to implement a pfNode isect call using strictly
> > > > bounding volume to bounding volume tests. There have been two threads in
> > > > the past two years on this with no answers. I have a test case put
> > > > together that puts a cube out there and runs an isect using strictly a
> > > > cylinder test as mentioned in the man pages and in the insight book. No
> > > > intersects are successful. Is anyone aware that this feature is either
> > > > implemented or not? Is there some secret handshake to get it to work
> > > > properly?
> > > >
> > > > Thanks.
> > >
> > > --
> > > For Performer+OpenGL tutorials http://www.dorbie.com/
> > >
> > > "In the middle of difficulty lies opportunity."
> > > --Albert Einstein
>
> --
> +---------------------------------+----------------------------------+
> |Benedikt J. Kessler | Silicon Graphics GmbH |
> |Professional Services | Am Hochacker 3 - Technopark |
> |SGI | 85630 Grasbrunn-Neukeferloh, FRG |
> | --- __o ,__o | |
> | ------_ \<,_ _-\_<, | Phone: (+49) 89 46108-366 or -0 |
> |----- (*)/ (*) (*)/'(*) | Fax: (+49) 89 46107-366 |
> +---------------------------------+----------------------------------+
> |E-Mail: bjk++at++sgi.com Web (private): http://reality.sgi.com/bjk |
> | Web: http://www.sgi.de/dienstleistungen/ |
> +--------------------------------------------------------------------+
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/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 2b29 : Tue Nov 21 2000 - 13:00:20 PST

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