Binary Space Partitions, or, Doom in 20 minutes

 The preceding structures required the hyperplanes which partition space to be parallel to the axes of the space. Often, it is benificial to allow partitioning planes with arbitrary orientation.
 

Constructing the tree:

Consider polygons in space or line segments in the plane, If the points are ordered badly, then we will get a large tree. Below, in A, the first node in the tree contains s1, s2 and s3. In B, each node contains only one segment.

It is hard to find a good ordering. We can settle for randomizing the order, and hoping for the best.

BSP Trees for Ray Tracing:

It is easy to find the first object which intersects a ray, using a BSP tree. In this case, we want to store objects in leaves of the tree, rather than in the internal nodes.

BSP Trees for Polygons

We can represent a polygon (or polytope) with a BSP tree. Let each face of the polygon coincide with a partitioning plane of the tree.

Now, each node of the tree encodes a face of the polygon. Each leaf of the tree is either inside or outside of the polygon.

It is easy to find out if a given point is inside the polygon; put it in the tree and see if it ends up in a + or - leaf (also have case of point exactly on a plane)

Also can do boolean operations on polygons: union, intersection.


[Start] [Back][Next] 
Douglas De Couto
decouto@graphics.lcs.mit.edu

Joshua Napoli
napoli@mit.edu

Last modified: Tue Mar 17 09:49:35 1998