Professional Documents
Culture Documents
Lec 39
Lec 39
Lec 39
Binary space partitioning trees. Used to store a collection of objects in ndimensional space. Tree recursively divides n-dimensional space using (n-1)-dimensional hyperplanes.
Space Partitioning
n-dimensional space
ax+by+cz+d = 0 (3D)
Space Partitioning
n-dimensional space +ve half space ax + by + c > 0 ax+by+cz+d > 0 coincident
ax + by + c = 0
ax+by+cz+d = 0
Classifying Object z
In 2D, ph is the line ax + by + c = 0.
Compute ax + by + c for all vertices of z. If all values are = 0; z is coincident to ph. If all values are <= 0; z is left of ph. If all values are >= 0; z is right of ph. Otherwise, z spans ph and is to be split by finding intersection points with ph.
2D
a
e
h
c d
f
Equation of ph is x6=0
2D
a
e
h
c 2 d
f
Equation of ph is y x 2 = 0
3D Equation of ph is
z 2 = 0 General: ax + by + cz + d = 0
z x
Space Partitioning
n-dimensional space coincident list
+ve
-ve
+ve
-ve
Objects in 2D
e h
c
d
Objects in 2D
e h
c
d
Objects in 2D
e h
a-d
e-h
c
d
Objects in 2D
e h
a-d
e-h
c
d
Objects in 2D
e h
c
d
a-b
c-d e-f
g-h
Objects in 2D
e h
c
d
f
a bc d e f g h
Collision Detection
e h
c
d
f
a bc d e f g h
Visibility Ordering
e h
c
d
f
a bc d e f g h
e h
c
d
Face of an object.
e h
c
d
Face of an object.
Autopartition
e h
c
d
e h
c
d
e h
c
d
e h
c
d
Balance # objects (pieces) on each side of hyperplane Minimize increase in number of objects/pieces.
3D Example
3D Example
3D Example
3D Example
Another 3D Example
Another 3D Example
f
d
d
f
With this orientation, left leaves are interior and right leaves are exterior.
a b a c c e b e
f
d
d
f
Randomization
Autopartition. Splitting hyperplane is randomly selected to be one of the object faces. Lines in 2D; planes in 3D.
e h
Start with n (nonintersecting) line segments. Total number of line segments in autopartition bsp is expected to be <= n + 2n ln n. If this bound is exceeded; rerun construction. Expected number of construction rounds before this bound is not exceeded is 2.
Randomization2D Analysis
8
n = 29 3 4 6
So, number of nodes in bsp is O(n log n). Construction time at each node is O(n) as at each node O(n) segments need to be partitioned. Time is O(n2log n) per construction round. 2 rounds expected. Expected complexity is O(n2log n).
Randomization 2D Analysis
8
n = 29 3 4 6
Randomization3D Analysis
Start with n (nonintersecting) triangles. Total number of triangles in autopartition bsp is O(n2). There exist n-triangle examples for which every autopartition has W(n2) triangles.
n = 24
Free Partitions
One that does not split an object. Do a free partition whenever possible; otherwise, randomly select a segment/face as partitioning hyperplane.
4 6
Free Partitions
Using an object face, that crosses a BSP region, results in a free partition of that BSP region.
Portion of black segment bounded by red (previous) splitting lines may be used to partition blue region. No segments in blue region can be split as line segments are nonintersecting.
Free Partitions
Using an object face, that crosses a BSP region, results in a free partition of that BSP region.
When green segment is used to partition blue region, segments in blue region may be split.