Professional Documents
Culture Documents
Lecture 15 6
Lecture 15 6
Lecture 15 6
Part II
• Depth Sort (Painter Algorithm)
Foley & Van Dam, Chapter 15
• Binary Space Partitioning Tree
• Area Subdivision Algorithms (Warnock’s)
B C
y y
C
Binary Space Partitioning Tree Binary Space Partitioning Tree
• Tests 3 and 4 in Depth Sort technique can be exploited
efficiently with BSP-Trees: • BSP Tree Algorithm:
• Let Lp be the plane P lies in. The 3D space may be divided • Construction of the BSP tree:
into the following three groups:
– Polygons in front of Lp
– Pick a polygon, let its supporting plane be the
– Polygons behind Lp root of the tree
– Polygons intersecting Lp – Create two lists of polygons: those in front, and
• Polygons in the third class are split, and resulting polygons are
those behind (splitting polygons if necessary)
classified into the first two classes
• As a result of the subdivision with respect to Lp: – Recurse on the two lists to create two sub-trees
– The polygons behind Lp cannot obscure P, so we can draw • Display:
them first
– P cannot obscure the polygons in front of Lp so we can draw – Traverse the BSP tree back to front, drawing
P second polygons in the order they are encountered in
– Finally we draw the polygons in front of P the traversal
3 3
6 6 5
7
5
4 4