Presentation is loading. Please wait.

Presentation is loading. Please wait.

A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.

Similar presentations


Presentation on theme: "A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating."— Presentation transcript:

1 a lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating plane?

2 a lion in the desert Cut the desert in two and ask in which part is the lion. Repeat the process for the part that the lion is in.

3 BSP Trees Binary Spatial Partitioning (BSP) means: –Partition (or split) a space (like the desert) into Binary (two) parts using a separating plane. –Repeat the process for both resulting subspaces and you will get a BSP tree.

4 What we see in this example is a simple model with four polygons. We will choose the splitting planes so that they lay on a polygon of the model.

5 Creating the tree We choose a splitting plane a split the space in two. Chosen Splitting Plane Root Node Front Node Back Node Associated Splitting Plane

6 Creating the tree Front Node Back Node Chosen Splitting Plane Associated Splitting Plane

7 Creating the tree Chosen Splitting Plane

8 Creating the tree Chosen Splitting Plane

9 Creating the tree The leaves of the tree are convex regions.

10 Traversing the Tree We want to render the scene from this point of view. In what order should we render the regions?

11 Traversing the Tree Test against the splitting plane Traverse the front subtree before the back subtree Rendering order: Test against the splitting plane

12 Creating the tree Test against the splitting plane Traverse the back subtree before the front subtree Rendering order: Test against the splitting plane

13 Creating the tree Rendering order: Traverse the front subtree before the back subtree Test against the splitting plane

14 Creating the tree Rendering order: Test against the splitting plane Traverse the back subtree before the front subtree

15 Creating the tree Rendering order: Test against the splitting plane Traverse the back subtree before the front subtree

16 Convex Cells The cells can be ordered back to front, or front to back.

17 F2B Order 1 2 3 4 5 6

18 1 2 3 4 5 6

19 Hidden Surface Removal Display: –Traverse the BSP tree back to front, drawing polygons in the order they are encountered in the traversal. Construct a BSP tree: –Pick a polygon, let its supporting plane be the root of the tree. –Create two lists of polygons: these in front, and those behind (splitting polygons as necessary). –Recurse on the two lists to create the two sub-trees.

20 BSP Construction 1 2 3 4 5 1 2 3 4 5 6 1 2 3 4 5 6 7 1 2 3 4 5 6

21 BSP Trees BSP-Trees are view-independent A good splitting plane minimize the number of polygon intersections, and aims at a balanced tree. How to choose the order of splitting planes during construction?

22 Point Location Given p, in which cell it resides?

23 Ray Traversal Given R, which cells, and in which order it traverses?


Download ppt "A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating."

Similar presentations


Ads by Google