Binary Space Partition (BSP) is a technique used in 3D computer graphics to render 3D scenes into 2D for display. It involves removing hidden surfaces using methods like painter's algorithm and backface culling. A BSP tree recursively subdivides n-dimensional space into convex subspaces. Random auto-partitioning of 3D space can be done by choosing a random permutation of line segments and partitioning space using free cuts that require no additional cuts. The expected number of fragments using this approach is O(n log n), an efficient partitioning of 3D space.
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.
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
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) }.]
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