Intersection problem

How do you determine the intersection of four or more planes?
Is there a simple trick to this?
I want to be able to create an primitive object (sphere, cube, piramid, …) only using the plane equotations of the faces of those objects… (like QBSP does)
I thought I had to determine

  1. intersections of two planes = line
  2. intersections of those lines = vertexes
  3. use the vertexes to create the polygon-data

I tried this by hand (i took me about an hour or so) on 6 planes ( a cube). So it does work… on a cube, but not on a cylinder, because you have to know wich planes cross wich

Or am i mistaken?

Try projective geometry. Calculating the intersection of primitives involves solving the determinant of a matrix. Easy.

Some references i have handy:

hmm, can’t find the other one, buit that should be helpful…


Actually, you are on the right track, you just need to intersect two planes to get a line, then intersect that line with the other planes to find potential points of the primitive. Now if the primitive is simple and convex, and all plane normals face outward, you can check to see if each point is in front, on, or behind a plane. A point will be a part of the primitive only if it is on or behind (inclusive) all other planes of the convex hull. So the instant one of the potential points is found to be in front of a plane, it can be thrown away immediately. Solving an augmented matrix, you can actually intersect three planes at a time to get each potential point rather than intersecting two planes and then intersecting that line with the other planes. And yes, it involves determinates and cofactors.

[This message has been edited by DFrey (edited 07-11-2000).]