Re: Intersection Test Problems

New Message Reply Date view Thread view Subject view Author view

Keith Fry (keithfry++at++vr2.engin.umich.edu)
Fri, 26 Jan 1996 18:16:32 -0500


On Jan 26, 3:56pm, Torsten Moeller wrote:
> Subject: Intersection Test Problems
> I experience problems doing intersection tests.
> I am walking around in a (virtual) building and am trying
> to always find the distance to the walls ahead.
> I took the xformer.c/collide.c library functions and modified them
> a little so I have an intersection segment of length 255.
> Most of the walls are working fine, but for some it seems
> I am getting the distance to walls behind the nearest one.
> I was then trying to play with the flags passed to the procedure
> pfuSegsIsectNode/pfSegsIsectGSet. The problem remains even if I
> do not set nor PFTRAV_IS_CULL_FRONT.

My first guess would be to check the orientation of the segment.
The man page for pfSegsIsectNode says:

     If discFunc is NULL, the default behavior clips the end of the segment
     after each successful intersection at the finest resolution (pfGeode
     bounding volume , pfGeoSet bounding box, pfGeoSet geometry) specified in
     mode. Thus, the segment is clipped by each successful intersection so
     that the intersection point nearest the starting point of the segment is
     returned upon completion.

So, if your segment is created such that the direction points toward you,
this may be the problem because the 'nearest starting point' is not your eye.

For instance:
| |
   eye <--------+-----+---* pfSeg.pos
| |
                      ^
                      This wall will be accepted because it is closer to
                      the starting point.

Another thing to check would be that the near wall is enabled for
intersections.

Good luck.

-- 
-----------------------------------------------------------------------
Keith Fry                 http://www-personal.engin.umich.edu/~keithfry
University of Michigan    email:               keithfry++at++engin.umich.edu
Virtual Reality Lab       work phone:                    (313) 763-7798

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:52:18 PDT

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