Binary Space Partition:
A binary space-partitioning (BSP) tree is an efficient method for finding object visibility by painting surfaces onto the screen from back to front, as in the painter's algorithm. The BSP tree is specifically useful while the view reference point changes, but in a scene the objects are at fixed positions.
Applying a BSP tree to visibility testing involves identify surfaces that are "inside" and "outside" the partitioning plane at each of step of the space subdivision, relative to the viewing direction. Figure show the basic concept in this algorithm. With plane P1, we first partition the space into two sets of objects. One of set of objects is behind, or in back of, plane P1 relative to the view plane P1, we divide that object into two separate objects, labelled A and B. Objects A & C are in front of P1, and objects B and D are behind P1. We next partition the space again with plane P2 and construct the binary tree representation illustrated in Figure (b). In this tree, the objects are represented as terminal nodes, with front objects as left branches and back objects like right branches.
Figure : A Region of Space is Partitioned with Two Planes P1 and P2 to form the BSP Tree Representation
For objects explained with polygon facets, we chose the partitioning planes to coincide with the polygon planes. The polygon equations are then utilized to identify "inside" and "outside" polygons, and the tree is built with one partitioning plane for each polygon face. Any polygon intersected through a partitioning plane is split into two parts. While the BSP tree is complete, we process the tree by choosing the surfaces for display in the order back to front, in order that foreground objects are painted over the background objects. Fast hardware implementations for making and processing BSP trees are utilized in some of the systems.