BSP Trees

Binary Space Paritition is a relatively easy way to sort the polygons relative to the eyepoint

To Build a BSP Tree
1. Choose a polygon, T, and compute the equation of the plane it defines.

2. Test all the vertices of all the other polygons to determine if they are in front of, behind, or in the same plane as T. If the plane intersects a polygon, divide the polygon at the plane.

3. Polygons are placed into a binary search tree with T as the root.

4. Call the procedure recursively on the left and right subtree.

Link to BSP Visualization from Brown University