A Walk through BSP Trees

Publisher Summary This chapter discusses traversal through binary space-partitioning (BSP) trees. BSP trees are data structures that allow for fast visible-surface determination in environments where the viewer moves while the polygonal objects remain static, as in interactive walkthroughs. One solution to the visible-surface problem is to render a scene's polygons in back-to-front order so that polygons nearer to the viewer overwrite those farther away. However, this simple painter's algorithm offers no consistent means of identifying polygon depth; choosing either the extreme vertices or the centroid as the sorting key fails in certain cases. This algorithm also fails in cases of cyclic overlaps and interpenetrating polygons. The depth sort algorithm solves all of these problems, but in a view-dependent way. This chapter describes the construction of BSP trees and their traversal, which generates polygons in a sorted order suitable for rendering. It also presents an efficient viewer/object collision detection algorithm based upon this versatile data structure.