From: Yves Strube (czys++at++ocag.ch)
Date: 10/17/2002 01:28:10
Hi all,
I discovered a problem when calculating the intersection of a line
segment with any geometry.
My camera is positioned at (0, 0, 0). I create a triangle with its
center at (0, ty, 0). Now a start an intersection test by using one line
segment starting at (0, 0, 0) pointing to (0, 1, 0) with the length
50000.
I expected that the line segment hits the triangle as long as ty is less
than 50000. But this did not happen.
If ty is less than about 9000 the intersection succeeds indepent of the
triangle's orientation (I also test the back faces for intersection). If
ty is greater than about 9000 the test fails depending on the triangle's
orientation:
If I change the pitch of the triangle (that is initially facing towards
me) with respect to its origin *only a few* degrees (e.g. 3 degrees) the
intersection fails. If I change the pitch further (e.g. to 4 degrees) it
succeeds again. Then it fails again and so on.
Since the effect depends on the distance between the start of the line
segment and the end I thought about rounding problems. The size of the
triangle's edges is only 2 units. But if the test succeeds the hit point
is always very close to the center of the triangle, e.g. at (0, 9310,
4.95265e-05). So this should not be a problem.
Also the problem described above occurs no matter if I test against
primitives (pfSegSet::mode = PFTRAV_IS_PRIM), the bounding boxes
(PFTRAV_IS_GSET) or the bounding sphere (PFTRAV_IS_GEODE) which should
not depend on the triangle's orientation at all!?
I wrote a simple program that demonstrates the effect. So if someone is
interested in this problem (maybe a Performer bug(?)) I can provide the
program's source code (about 250 lines).
I hope someone has an idea,
Yves
--Oerlikon-Contraves AG Yves Strube, SEI2 Birchstr. 155 Email: czys++at++ocag.ch CH-8050 Zurich Phone: +41 1 316 2675 Switzerland Fax: +41 1 316 2032
This archive was generated by hypermail 2b29 : Thu Oct 17 2002 - 01:28:28 PDT