Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Visibility Problem and Binary Space Partition

Similar presentations


Presentation on theme: "The Visibility Problem and Binary Space Partition"— Presentation transcript:

1 The Visibility Problem and Binary Space Partition
Slides prepared by

2 The Visibility Problem
a c e d

3 Z-buffering Draw objects in arbitrary order
For each pixel, maintain depth (“z”) Only draw pixel if new “z” is closer Instead: draw objects in order, from back to front (“painter’s algorithm”)

4 Binary Planar Partitions
1 b ab 1 cde 2 a c a b de 3 c 3 2 e d e d

5 Painter’s Algorithm 1 b 1 2 a c a b 3 c 3 2 e d e d

6 Binary Planar Partitions
c

7 Auto-partitions a b1 b1 b2,c c b b2 b2 a c

8 Auto-partitions a b1 b1 b2,c b2 b2 c1 c2 a c1 c c2

9 Auto-partitions 1+2+3+∙∙∙+n = n(n+1)/2 = O(n2)

10 Binary Planar Partitions
Goal: Find binary planer partition, with small number of fragmentations

11 Random Auto-Partitions
Choose random permutation of segments (s1, s2, s3,…, sn) While there is a region containing more than one segment, separate it using first si in the region

12 Random Auto-Partitions
v1 v4 v2 v3 u can cut v4 only if u appears before v1,v2,v3,v4 in random permutation P(u cuts v4) ≤ 1/5

13 Random Auto-Partitions
v1 v4 v2 v3 E[number of cuts u makes] = E[num cuts on right] + E[num cuts on left] = E[Cv1+Cv2+∙∙∙] + E[Ct1+Ct2+∙∙∙] = E[Cv1]+ E[Cv2]+∙∙∙ + E[Ct1]+ E[Ct2]+∙∙∙ ≤ 1/2+1/3+1/4+∙∙∙+1/n + 1/2+1/3+1/4+∙∙∙+1/n = O(log n) E[total number of fragments] = n + E[total number of cuts] = n + uE[num cuts u makes] = n+nO(log n) = O(n log n) Cv1=1 if u cuts v1, 0 otherwise

14 Random Auto-Partitions
Choose random permutation of segments (s1, s2, s3,…, sn) While there is a region containing more than one segment, separate it using first si in the region O(n log n) fragments in expectation

15 Use internal fragments immediately as “free” cuts

16 Binary Space Partitions
Without free cuts: O(n3) With free cuts: O(n2)


Download ppt "The Visibility Problem and Binary Space Partition"

Similar presentations


Ads by Google