Click to See Complete Forum and Search --> : intersecting planes


islheg
May 4th, 2004, 12:09 PM
I am making a opengl game under C#. I want to know if two planes are intersecting. Does anyone have any hints?

IslHeg

OReubens
May 5th, 2004, 03:43 PM
If you're talking about real planes (going into infinity), they will intersect unless they are paralel.
Otherwise, they will either intersect with the intersection being a line, of the two planes are identical.

Mathematically speaking, checking if planes intersect is easy enough.

How do you have the plane defined ? Do you have the plane's (carthesian) formula (ux+vy+wz+t=0) or do you have the coordinates for (at least) 3 points (not all lying on the same line) lying on the plane ?

1) If you have the carthesian formula for both planes
The planes will be parallel if (u1*u2) + (v1*v2) + (w1+w2) = 0
if the result is nonzero, the planes will intersect.

2) If you have the plane defined through 3 points, the easiest is to convert to the carthesian formula. and use step 1.

OReubens
May 5th, 2004, 03:46 PM
I forgot to mention that although this is mathematically an easy problem, things may not be quite as easy when dealing with the float/double type. small imperfections in each coordinate/intermediate calculation may end up giving you a result which isn't quite 0.0 even though it should be. Simply testing the result to be equal to 0.0 won't do.

You will need to experiment (or work out the maximum possible accumulated error) and test the result to lie in the range -accerr..+accerr