Intersection testing

New Message Reply Date view Thread view Subject view Author view

From: Yves Strube (czys++at++ocag.ch)
Date: 12/19/2001 01:11:18


Hi all,

I want to intersect a line segment with an aircraft model but this fails
sometimes. I positioned the aircraft directly over my camera position
which is p1 = (x, y, z) = (0, 0, 445). The line segment starts at my
camera position and ends at the aircraft model's origin which is inside
the aircraft's body.
I specify the line segment with psSeg::makePts(p1, p2) where p2 is the
aircraft's position. The intersection test is done with

int hitNo = scene->isect(&segset, hits)

(I use more than one line segment so I use a whole segment set segset;
scene is my pfScene object) with

segset.mode = PFTRAV_IS_GSET | PFTRAV_IS_PATH;
segset.activeMask = 0;

Then I increase the distance to the aircraft by moving the aircraft in
positive z direction. If the aircraft is positioned at around (0, 0,
9000) the intersection test suddenly fails, i.e. the line segment does
not hit anything at all how the return value hitNo indicates. It worked
for all distances up to z = 9000. If I further increase the distance it
succeeds again but fails from time to time.
I also observed the same effect for objects which are closer to the
camera, around 2000 units under certain object orientations.

My first thoughts were:

- Maybe a numerical error because I first specified the line segment by
a point and a unit direction vector. This can I think not be a problem
if I specify the line segment by start and end point. And the effect is
the same with either method.

- The line segment is too short. This is not the case since the same
effect occurs if I multiply the end point by a factor.

- The aircrafts origin is outside the aircraft's body. This is also not
the case.

So is there anything I am doing wrong, maybe a setting in the segset
strcuture?

Thanks for any answers,
Yves

-- 

Oerlikon-Contraves AG Yves Strube, S-EMI Birchstr. 155 Email: czys++at++ocag.ch CH-8050 Zurich Phone: +41 1 316 2675 Switzerland Fax: +41 1 316 2032


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Dec 19 2001 - 01:10:48 PST

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