Plane/Segment intersection problem

Topics: User Forum
Jan 25, 2007 at 5:47 PM
First of all thank you for this beautiful library!

I'm not sure if I'm using the library in the correct way, but with the following code I get wrong results:
if a segment from point A to point B intersects the plane, also the segment from B to A should intersect,
but I get false from the first test.

// z = 0
Plane plane = new Plane(Vector3F.ZAxis, 0);
Vector3F pointA = new Vector3F(0, 0, -1);
Vector3F pointB = new Vector3F(0, 0, 1);
Segment segmentAB = new Segment(pointA, pointB);
Segment segmentBA = new Segment(pointB, pointA);
IntersectionPair intersection = IntersectionMethods.Intersects(segmentAB, plane);
intersection = IntersectionMethods.Intersects(segmentBA, plane);

Many thanks,
Stenio Brunetta