Binary Space Partition
Presented by:-
Gopal Kumar
Motivation
To do so we have to remove the
hidden surface.
It is done using techniques like
● painters algo
● Backface culling
● Z buffer etc.
In computer graphics any 3D scene has to be rendered into a 2D scene that can be
viewed on a screen.
Painter’s Algorithm
● The algorithm first computes a sorting of objects in order of their closeness to the
view point.
● Then paints objects in that order back-to-front.
BSP Tree of an Object
A Binary Space Partitioning
(BSP) tree is a data structure that
represents a recursive,
hierarchical subdivision of n-
dimensional space into convex
subspaces.
Binary Planar partition
1+2+3+∙∙∙+n = n(n+1)/2 = O(n
2)
Binary Planar Partitions (cont.)
Goal:
Find binary planer partition,
with small number of fragmentations
Random Auto-Partitions
Choose random permutation of segment from
s=(s1, s2, s3,…, sn)
v=set of segments intersecting s.
While there is a region containing more than one
segment,
separate it using first si in the region
Random Number
Let cvi be random variable
Cvi =
Let x be total number of cuts
x=∑n
i=1 cvi
From linearity of expectation
E(x)=∑n
i=1 E(cvi )
1 ; if ui
th segment intersects v
0 ; else
Random Auto-Partitions(cont.)
u can cut v4 only if u appears before v1,v2,v3,v4 in random permutation
P(u cuts v4) ≤ 1/5
Random Auto-Partitions(cont.)
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 + SuE[num cuts u makes] = n+nO(log n) = O(n log n)
Free Cut
When a line segment is chosen, it is extended until it partitions the region containing it
into two regions.Further, we can make this cut at no additional increase in the number
of segments that are cut, since s partitions R. Such a cut is called a free cut.
An example of a free cut.
Random Auto Partitioning using free cut
𝜋* = random permutation of the input segments, with free-cuts,
used by the algorithm.
𝜋*: Line(u(i)) makes a non-free cut of segment v only if:
either u(i) precedes all of {v, u(1), u(2), … , u(i-1) },
or u(i) precedes all of {v, u(i+1), u(i+2), … , u(k) }.
[Note: both conditions hold if u(i) precedes all of { v, u(1), … , u(k) }.]
Binary Space Partition in 3D (including free cut)
Free cut in 3D space
Y(k) be the total number of additional cuts created by uπt(k). Yku be the number of these on
input triangle u E {u1, u2 , ... ,un }{uπ(k)}. Total "fragmentation" - the number of cuts - is
ΣkYk =ΣkΣuYku.
The goal is to show that E[Yku] is O(1)
To calculate Yku we consider the sub-facets of u that are cut by h(uπ(k)).
Consider the arrangement Lπ,k of line segments { lπ(1), lπ(2), …...lπ(k)} on the triangle u,
where the line segment lπ(i) is the intersection of h(uπ(i)) with triangle u, for 1 < i < k.For
an arrangement L of k lines l1 , l2 ,.... ,lk on triangle u and for 1 < i < k, let x(L,i) denote the
number of external regions in the arrangement L-{li} that are cut by li.Observe that ΣK
i=1x( L,
i) equals the total number of edges bounding the external sub-facets of L.
In given figure , for instance, ΣK
i=1x( L, i) = 12. So we ΣK
i=1x( L, i) = O(k) for any
arrangement L on a triangle u. Since π is a random permutation, lπ(k) is equiprobable any of
the lines in the arrangement L. Thus
Thank you

Binary space partition

  • 1.
  • 2.
    Motivation To do sowe have to remove the hidden surface. It is done using techniques like ● painters algo ● Backface culling ● Z buffer etc. In computer graphics any 3D scene has to be rendered into a 2D scene that can be viewed on a screen.
  • 3.
    Painter’s Algorithm ● Thealgorithm first computes a sorting of objects in order of their closeness to the view point. ● Then paints objects in that order back-to-front.
  • 4.
    BSP Tree ofan Object A Binary Space Partitioning (BSP) tree is a data structure that represents a recursive, hierarchical subdivision of n- dimensional space into convex subspaces.
  • 9.
  • 10.
    Binary Planar Partitions(cont.) Goal: Find binary planer partition, with small number of fragmentations
  • 11.
    Random Auto-Partitions Choose randompermutation of segment from s=(s1, s2, s3,…, sn) v=set of segments intersecting s. While there is a region containing more than one segment, separate it using first si in the region
  • 12.
    Random Number Let cvibe random variable Cvi = Let x be total number of cuts x=∑n i=1 cvi From linearity of expectation E(x)=∑n i=1 E(cvi ) 1 ; if ui th segment intersects v 0 ; else
  • 13.
    Random Auto-Partitions(cont.) u cancut v4 only if u appears before v1,v2,v3,v4 in random permutation P(u cuts v4) ≤ 1/5
  • 14.
    Random Auto-Partitions(cont.) E[number ofcuts 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 + SuE[num cuts u makes] = n+nO(log n) = O(n log n)
  • 15.
    Free Cut When aline segment is chosen, it is extended until it partitions the region containing it into two regions.Further, we can make this cut at no additional increase in the number of segments that are cut, since s partitions R. Such a cut is called a free cut. An example of a free cut.
  • 16.
    Random Auto Partitioningusing free cut 𝜋* = random permutation of the input segments, with free-cuts, used by the algorithm.
  • 17.
    𝜋*: Line(u(i)) makesa non-free cut of segment v only if: either u(i) precedes all of {v, u(1), u(2), … , u(i-1) }, or u(i) precedes all of {v, u(i+1), u(i+2), … , u(k) }. [Note: both conditions hold if u(i) precedes all of { v, u(1), … , u(k) }.]
  • 19.
    Binary Space Partitionin 3D (including free cut) Free cut in 3D space
  • 20.
    Y(k) be thetotal number of additional cuts created by uπt(k). Yku be the number of these on input triangle u E {u1, u2 , ... ,un }{uπ(k)}. Total "fragmentation" - the number of cuts - is ΣkYk =ΣkΣuYku. The goal is to show that E[Yku] is O(1) To calculate Yku we consider the sub-facets of u that are cut by h(uπ(k)). Consider the arrangement Lπ,k of line segments { lπ(1), lπ(2), …...lπ(k)} on the triangle u, where the line segment lπ(i) is the intersection of h(uπ(i)) with triangle u, for 1 < i < k.For an arrangement L of k lines l1 , l2 ,.... ,lk on triangle u and for 1 < i < k, let x(L,i) denote the number of external regions in the arrangement L-{li} that are cut by li.Observe that ΣK i=1x( L, i) equals the total number of edges bounding the external sub-facets of L.
  • 21.
    In given figure, for instance, ΣK i=1x( L, i) = 12. So we ΣK i=1x( L, i) = O(k) for any arrangement L on a triangle u. Since π is a random permutation, lπ(k) is equiprobable any of the lines in the arrangement L. Thus
  • 22.