ABSTRACT

In most applications involving computation with 3D geometric models, manipulating objects and generating images of objects are crucial operations. Performing these operations requires determining for every frame of an animation the spatial relations between objects: how they might intersect each other, and how they may occlude each other. However, the objects, rather than being monolithic, are most often comprised of many pieces, such as by many polygons forming the faces of polyhedra. The number of pieces may be anywhere from the 100’s to the 1,000,000’s. To compute spatial relations between n polygons by brute force entails comparing every pair of polygons, and so would require O(n2). For large scenes comprised of 105 polygons, this would mean 1010 operations, which is much more than necessary. The number of operations can be substantially reduced to anywhere from O(n log2 n)

when the objects interpenetrate (and so in our example reduced to 106), to as little as constant time, O(1), when they are somewhat separated from each other. This can be accomplished by using Binary Space Partitioning Trees, also called BSP Trees. They provide a computational representation of space that simultaneously provides a search structure and a representation of geometry. The reduction in number of operations occurs because BSP Trees provide a kind of “spatial sorting”. In fact, they are a generalization to dimensions> 1 of binary search trees, which have been widely used for representing sorted lists. Figure 20.1 below gives an introductory example showing how a binary tree of lines, instead of points, can be used to “sort” four geometric objects, as opposed to sorting symbolic objects such as names. Constructing a BSP Tree representation of one or more polyhedral objects involves com-

puting the spatial relations between polygonal faces once and encoding these relations in a binary tree (Figure 20.2). This tree can then be transformed and merged with other trees to very quickly compute the spatial relations (for visibility and intersections) between the polygons of two moving objects.