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

2 The Visibility Problem a b c d e

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 a b c d e 0 1 2 3 0 1 2 3 abc de ab cde de

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

6 Binary Planar Partitions a b c b1 b2

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

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

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

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

11 Random Auto-Partitions Choose random permutation of segments (s 1, s 2, s 3,…, s n ) While there is a region containing more than one segment, separate it using first s i in the region

12 Random Auto-Partitions u can cut v 4 only if u appears before v 1,v 2,v 3,v 4 in random permutation P(u cuts v 4 ) ≤ 1/5 u v1v1 v2v2 v3v3 v4v4

13 Random Auto-Partitions u v1v1 v2v2 v3v3 v4v4 t1t1 t3t3 t2t2 E[number of cuts u makes] = E[num cuts on right] + E[num cuts on left] = E[C v1 +C v2 +∙∙∙] + E[C t1 +C t2 +∙∙∙] = E[ C v1 ]+ E[ C v2 ]+∙∙∙ + E[ C t1 ]+ E[ C t2 ]+∙∙∙ ≤ 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 +  u E[num cuts u makes] = n+nO(log n) = O(n log n) C v1 =1 if u cuts v 1, 0 otherwise

14 Random Auto-Partitions Choose random permutation of segments (s 1, s 2, s 3,…, s n ) While there is a region containing more than one segment, separate it using first s i in the region O(n log n) fragments in expectation

15 Free cuts Use internal fragments immediately as “free” cuts

16 Binary Space Partitions Without free cuts: O(n 3 ) With free cuts: O(n 2 )


Download ppt "The Visibility Problem and Binary Space Partition."

Similar presentations


Ads by Google