source: trunk/VUT/doc/SciReport/analysis.tex @ 266

Revision 266, 41.7 KB checked in by bittner, 19 years ago (diff)

structural changes

Line 
1\chapter{Analysis of Visibility in Polygonal Scenes}
2
3This chapter provides analysis of the visibility in polygonal scenes,
4which are the input for all developed tools. The visibility analysis
5uncoveres the complexity of the from-region and global visibility
6problems and thus it especially important for a good design of the
7global visibility preprocessor. To better undestand the visibility
8relationships in primal space we use mapping to line space, where the
9visibility interactions can be observed easily by interactions of sets
10of points. Additionally for the sake of clarity, we first analyze
11visibility in 2D and then extend the analysis to 3D polygonal scenes.
12
13\section{Analysis of visibility in 2D}
14
15\label{LINE_SPACE}
16
17The proposed visibility algorithm uses a mapping of oriented 2D lines to
18points in 2D oriented projective space --- {\em line space}. Such a
19mapping allows to handle sets of lines much easier than in the primal
20space~\cite{pv-vc-93}.
21
22 We use a 2D projection of Pl\"ucker
23coordinates~\cite{Stolfi:1991:OPG} to parametrize lines in the plane.
24This mapping corresponds to an ``oriented form'' of the duality
25between points and lines in 2D.  Let $l$ be an oriented line in
26${\mathcal R}^2$ and let $u=(u_x, u_y)$ and $v=(v_x, v_y)$ be two
27distinct points lying on $l$. Line $l$ oriented from $u$ to $v$ can be
28described by the following matrix:
29
30$$
31M_l=\left(
32\begin{array}{cccc}
33u_x & u_y & 1 \\
34v_x & v_y & 1 
35\end{array}
36\right)
37$$
38
39Pl\"ucker coordinates $l^*$ of $l$ are minors of $M_l$:
40
41$$
42l^* = (l^*_x, l^*_y, l^*_z) = (u_y - v_y, v_x - u_x, u_x v_y - u_y  v_x ).
43$$
44
45$l^*$ can be interpreted as homogeneous coordinates of a point in 2D
46{\em oriented projective space} ${\cal P}^2$. Two oriented lines are
47equal if and only if their Pl\"ucker coordinates differ only by a
48positive scale factor. $l^*$ also corresponds to coefficients of the
49implicit equation of a line: $l'$ expressed as $l': ax + by + c= 0$
50induces two oriented lines $l^*_1$, $l^*_2$, with Pl\"ucker
51coordinates $l^*_1 = (a, b, c)$ and $l^*_2 = -(a,b,c)$.  The \plucker
52coordinates of 2D lines defined in this chapter are a simplified form
53of the \plucker coordinates for 3D lines that will be discussed in
54Chapter~\ref{chap:rot3d}: \plucker coordinates of a 2D line correspond
55to the \plucker coordinates of a 3D line embedded in the $z = 0$ plane
56after removal of redundant coordinates (equal to 0) and permutation of
57the remaining ones (including some sign changes).
58
59
60 Homogeneous coordinates are often normalized, e.g. $l^*_N = (a/b, 1,
61c/b)$. The normalization introduces a singularity --- in our example
62vertical lines map to points at infinity. To avoid singularities we
63treat ${\cal P}^2$ as 3D linear space and call it {\em line space}
64denoted ${\mathcal L}$. Consequently, $l^*$ represents a halfline in
65${\mathcal L}$. All points on halfline $l^*$ represent the same
66oriented line $l$.
67
68 To sum up: an oriented line in 2D is mapped to a halfline beginning
69at the origin in 3D. An example of the concept is depicted in
70Figures~\ref{lines1}-(a) and ~\ref{lines1}-(b). Further in this
71chapter we will mostly use ``projected'' 2D illustrations of line
72space (such as in Figure~\ref{lines1}-(c)). We will still talk about
73planes and halflines, but they will be depicted as lines and points,
74respectively, for the sake of clarity of the presentation.
75
76
77\subsection{Lines passing through a point}
78
79 A {\em pencil of oriented lines} passing through a point $p = (p_x,
80p_y)  \in {\mathcal R}^2$ maps to an oriented plane $p^*$ in line
81space that is expressed as:
82$$
83p^* = \{(x,y,z) | (x,y,z) \in {\mathcal L}, p_x x + p_y y + z = 0\}.
84$$
85
86This plane subdivides ${\mathcal L}$ in two open halfspaces $p^*_+$
87and $p^*_-$. Points in $p^*_-$ correspond to oriented lines passing
88clockwise around $p$ (see Figure~\ref{lines1}).  Points in $p^*_+$
89correspond to oriented lines passing counterclockwise around $p$
90(these relations depend on the orientation of the primal space). We
91denote $-p^*$ an oriented plane opposite to $p^*$ that can be
92expressed as:
93$$
94-p^* = \{(x,y,z) | (x,y,z) \in {\mathcal L}, -p_x x - p_y y - z = 0\}.
95$$
96
97
98\begin{figure*}[tb]
99\rule{0pt}{0pt}\hfill
100\includegraphics[width=1.0\textwidth,draft=\DRAFTFIGS]{figs/lines1}
101\hfill\rule{0pt}{0pt}
102\centerline{\small \hspace{0.01\textwidth}{\bf (a)}\hspace{0.3\textwidth} {\bf (b)} \hspace{0.3\textwidth} {\bf (c)}}
103\vspace{-1.5em}
104\caption{
105{\bf (a)} Four oriented lines in primal space.
106{\bf (b)} Mappings of the four lines and point p.
107Lines intersecting p map to plane $p^*$.
108Lines passing clockwise (counterclockwise) around $p$, map to
109$p^*_-$ ($p^*_+$).
110{\bf (c)} The situation after projection to a plane perpendicular to $p^*$.  }
111\label{lines1}
112\end{figure*}
113
114\subsection{Lines passing through a line segment}
115
116 Oriented lines passing through a line segment can be decomposed into
117two sets depending on their orientation.  Consider a supporting line
118$l_S$ of a line segment $S$, that partitions the plane in open
119halfspaces $S^+$ and $S^-$. Denote $a$ and $b$ the two endpoints of
120$S$ and $a^*$ and $b^*$ their mappings to ${\mathcal L}$. Lines that
121intersect $S$ and ``come from'' $S^-$ can be expressed in line space
122as an intersection of halfspaces $a^*_+$ and $b^*_-$.  The opposite
123oriented lines intersecting $S$ are expressed as $a^*_- \cap b^*_+$
124(see Figure~\ref{lines2}-(a,b)).
125
126%\begin{minipage}{\textwidth}
127
128\begin{figure}[htb]
129\rule{0pt}{0pt}\hfill
130\includegraphics[width=0.6\textwidth,draft=\DRAFTFIGS]{figs/lines2}
131\hfill\rule{0pt}{0pt}
132\centerline{\small
133\hspace{0.01\textwidth}{\bf (a)}\hspace{0.2\textwidth} {\bf (b)}
134}
135\vspace{-1.5em}
136\caption{ {\bf (a)} A line segment $S$ and three oriented lines that
137intersect $S$.  {\bf (b)} The situation in line space: the projection of two
138wedges corresponding to lines intersecting $S$. Mappings of supporting
139line $l_S$ of $S$ are two halflines that project to point
140$l_S^*$. Line $k$ intersects point $b$ and therefore maps to plane
141$b^*$. Lines $m$ and $n$ map to the wedge corresponding to their
142orientation.  }
143\label{lines2}
144\end{figure}
145
146
147
148
149\subsection{Lines passing through two line segments}
150
151\label{sec:blocker_polygon}
152
153Consider two disjoint line segments such as those depicted in
154Figure~\ref{lines3}-(a). The set of lines passing through the two line
155segments can be described as an intersection of four halfspaces in
156line space. The four halfspaces correspond to mappings of endpoints of
157the two line segments.  Since the halfspaces pass through the origin
158of ${\mathcal L}$, their intersection is a pyramid with the apex at
159the origin. The boundary halflines of the pyramid correspond to
160mappings of the four {\em extremal lines} induced by the two
161segments. Denote ${\mathcal P}(S, O)$ a line space pyramid
162corresponding to oriented lines intersecting line segments $S$ and $O$
163in this order.  We represent the pyramid by a {\em blocker polygon}
164$B(S, O)$ (see Figure~\ref{lines3}-(b)). Since $B(S, O)$ only
165represents the pyramid ${\mathcal P}(S, O)$, it need not be a planar
166polygon, i.e. its vertices may lay anywhere on the boundary halflines
167of ${\mathcal P}(S, O)$.  We normalize the vertex coordinates: they
168correspond to an intersection of the boundary halfline of ${\mathcal
169P}(S, O)$ and the unit sphere centered at the origin of ${\mathcal L}$.
170
171\begin{figure}[htb]
172\hfill\rule{0pt}{0pt}
173\includegraphics[width=0.7\textwidth,draft=\DRAFTFIGS]{figs/lines3}
174\hfill\rule{0pt}{0pt}
175\centerline{\small
176\hspace{0.01\textwidth}{\bf (a)}\hspace{0.2\textwidth} {\bf (b)}
177}
178\vspace{-1.5em}
179\caption{ {\bf (a)} Two line segments and corresponding four extremal lines
180oriented from $S$ to $O$. Separating lines $ad$ and $bc$ bound region
181of partial visibility of $S$ behind $O$ (penumbra). Supporting lines
182$ac$ and $bd$ bound region where $S$ is invisible (umbra). {\bf (b)}
183Blocker polygon $B(S,O)$ representing pyramid ${\mathcal
184P}(S,O)$.
185}
186\label{lines3}
187\end{figure}
188
189
190In Figure~\ref{lines4}-(a), the supporting line of $cd$ intersects $ab$
191at point $x$.  The set of rays passing through $ab$ and $cd$ can be
192decomposed to rays passing through $ax$ and $cd$, and through $xb$
193and $cd$. Rays through $ax$ and $cd$ map to a pyramid that is
194described by intersection of only three halfspaces induced by mappings
195of $a$, $x$ and $d$. Rays through $xb$ and $cd$ can be
196described similarly. The configuration in line space is depicted in
197Figure~\ref{lines4}-(b).
198
199\begin{figure}[htb]
200\rule{0pt}{0pt}\hfill
201\includegraphics[width=0.7\textwidth,draft=\DRAFTFIGS]{figs/lines4}
202\hfill\rule{0pt}{0pt}
203\centerline{\small
204\hspace{0.01\textwidth}{\bf (a)}\hspace{0.2\textwidth} {\bf (b)}
205}
206\vspace{-1.5em}
207\caption{ {\bf (a)} Degenerate configuration of line segments: the supporting
208line of $cd$ intersects $ab$ at point $x$. There are five extremal
209lines. Note, that there is no umbra region. {\bf (b)} In line space the
210configuration yields two pyramids sharing a boundary that is a
211mapping of the oriented line $cd$.
212}
213\label{lines4}
214\end{figure}
215
216\subsection{Lines passing through a set of line segments}
217
218 Consider a set of $n+1$ line segments. We call one line segment the
219{\em source} (denoted by $S$) and the other $n$ segments we call
220occluders (denoted by $O_k$, $1 \leq k \leq n$).  Further in the
221chapter we will use the term {\em ray} as a representative of an
222oriented line that is oriented from the source ``towards'' the
223occluders.
224
225Assume that we can process all occluders in a strict front-to-back
226order with respect to the given source. We have already processed $k$
227occluders and we continue by processing $O_{k+1}$.  $O_{k+1}$ can be
228visible through rays that correspond to the pyramid ${\mathcal P}(S,
229O_{k+1})$. Nevertheless some of these rays can be blocked by
230combination of already processed occluders $O_x$ ($1\leq x \leq k$).
231To determine if $O_{k+1}$ is visible we subtract all ${\mathcal
232P}(S,O_x)$ from ${\mathcal P}(S,O_{k+1})$:
233
234$$
235{\mathcal V}(S,O_{k+1}) = {\mathcal P}(S,O_{k+1})\ - \bigcup_{1 \leq x \leq k} {\mathcal P}(S,O_x)
236$$
237
238${\mathcal V}(S, O_{k+1})$ is a set pyramids representing rays through
239which $O_{k+1}$ is visible from $S$.  In turn, all rays corresponding
240to ${\mathcal V}(S,O_{k+1})$ are blocked behind $O_{k+1}$.  If
241${\mathcal V}(S, O_{k+1})$ is an empty set, occluder $O_{k+1}$ is
242invisible. This suggest incremental construction of an arrangement of
243pyramids ${\mathcal A}_k$ that corresponds to rays blocked by the
244$k$ processed occluders.  We determine ${\mathcal V}(S,O_{k+1})$ and
245${\mathcal A}_{k+1}$ (${\mathcal A}_0$ is empty):
246
247$$
248{\mathcal V}(S,O_{k+1}) = {\mathcal P}(S,O_{k+1}) \ - \ {\mathcal A}_k,
249$$
250$$
251{\mathcal A}_{k+1} = {\mathcal A}_k \cup {\mathcal P}(S,O_{k+1}) =
252{\mathcal A}_k \ \cup \ {\mathcal V}(S,O_{k+1}).
253$$
254
255 Figures~\ref{lines5}-(a,b) depict a projection of an arrangement
256${\mathcal A}_3$ of a source and three occluders. Note that the
257shorter the source line segment the narrower ($s^*_a$ and $s^*_b$ get
258closer) are the pyramids ${\mathcal P}(S,O_k)$.
259
260
261
262
263\begin{figure}[htb]
264\rule{0pt}{0pt}\hfill
265\includegraphics[width=0.6\textwidth,draft=\DRAFTFIGS]{figs/rot2new}
266\hfill\rule{0pt}{0pt}
267\centerline{\small
268\hspace{0.01\textwidth}{\bf (a)}\hspace{0.2\textwidth} {\bf (b)}
269}
270\vspace{-1.5em}
271\caption{  {\bf (a)} The source line segment $S$ and three
272occluders. $Q_{1-3}$ denote unoccluded funnels.  {\bf (b)} The
273line space subdivision. For each cell, the corresponding occluder-sequence
274is depicted.  Note the cells $Q^*_1$, $Q^*_2$ and $Q^*_3$
275corresponding to unoccluded funnels.}
276\label{lines5}
277\end{figure}
278
279Recall that the pyramid ${\mathcal P}(S,O_k)$ is represented by
280blocker polygon $B(S,O_k)$. The construction of the arrangement
281${\mathcal A}_k$ resembles the from-point visibility problem, more
282specifically the hidden surface removal applied on the blocker
283polygons with respect to the origin of ${\mathcal L}$. The difference
284is that the depth information is irrelevant in line space. The
285priority of blocker polygons is either completely determined by the
286processing order of occluders or their depth must be compared in
287primal space. This observation is supported by the classification of
288visibility problems presented in
289Chapter~\ref{chap:classes}. Visibility from point in 3D and visibility
290from region in 2D induce a two-dimensional problem-relevant line
291set. This suggests the possibility of mapping one problem to another.
292
293In the next section we show how the arrangement ${\mathcal A}_k$ can
294be maintained consistently and efficiently using the occlusion tree.
295
296
297
298\section{Pl\"ucker coordinates of lines in 3D}
299
300\label{sec:plucker}
301
302
303 We will use a mapping that describes an oriented 3D line as a point
304in a projective 5D space~\cite{Boissonnat98} by means of \plucker
305coordinates~\cite{Teller92phd,p-rsls-97,yn-sbgtc-97,Pu98-DSGIV}. \plucker
306coordinates allow to represent sets of lines using 5D polyhedra and to
307compute visibility by means of polyhedra set operations in 5D.
308
309 A line in 3D can be described by homogeneous coordinates of two
310distinct points on that line. Let $l$ be a line in ${\cal R}^3$ and
311let $\mbi{u}=(u_x, u_y, u_z, u_w)$ and $\mbi{v}=(v_x,v_y,v_z, v_w)$ be
312two distinct points in homogeneous coordinates lying on $l$. A line
313$l$ oriented from $\mbi{u}$ to $\mbi{v}$ can be described by the following matrix:
314
315\begin{equation}
316l=\left(
317\begin{array}{cccc}
318u_{x} & u_{y} & u_{z} & u_{w} \\
319v_{x} & v_{y} & v_{z} & v_{w}
320\end{array}
321\right)
322\label{coord_cara}
323\end{equation}
324
325Minors of the matrix correspond to components of the {\em \plucker
326coordinates} $\bpi_l$ of line $l$:
327
328\begin{equation}
329\begin{array}{ll}
330\bpi_l & =  (\pi_{l0}, \pi_{l1}, \pi_{l2}, \pi_{l3}, \pi_{l4}, \pi_{l5}) = \\
331       & =  (\xi_{wx},\xi_{wy},\xi_{wz},\xi_{yz},\xi_{zx},\xi_{xy}),
332\end{array}
333\label{eq:plucker_coords_def}
334\end{equation}
335
336where
337
338\begin{equation}
339\xi_{rs} = det\left(
340\begin{array}{cc}
341u_{r} & u_{s} \\
342v_{r} & v_{s}
343\end{array}
344\right).
345\end{equation}
346
347Substituting $u_w=1$ and $v_w=1$ into Eq.~\ref{eq:plucker_coords_def}
348enumerates to:
349
350\begin{equation}
351\begin{array}{l}
352\pi_{l0} = v_x - u_x\\
353\pi_{l1} = v_y - u_y\\
354\pi_{l2} = v_z - u_z\\
355\pi_{l3} = u_{y}v_{z} - u_{z}v_{y}\\
356\pi_{l4} = u_{z}v_{x} - u_{x}v_{z}\\
357\pi_{l5} = u_{x}v_{y} - u_{y}v_{x}
358\end{array}
359\label{eq:plucker_coords}
360\end{equation}
361
362The \plucker coordinates $\bpi_l$ can be seen as homogeneous
363coordinates of a point in a projective five-dimensional space ${\cal
364P}^5$. We call this point a {\em \plucker point} $\ppoint_l$ of
365$l$. For a given oriented line $l$ the \plucker coordinates $\bpi_l$
366are unique and they do not depend on the choice of points $p$ and $q$.
367We will use the notation of a \plucker point $\ppoint_l$ in the case
368when we want to stress that the corresponding \plucker coordinates
369$\bpi_l$ are interpreted as a point in ${\cal P}^5$.
370
371Using the projective duality the \plucker coordinates can be
372interpreted as coefficients of a hyperplane. The {\em \plucker
373coefficients} $\bomega_l$ of line $l$ are given as:
374
375
376\begin{equation}
377\begin{array}{ll}
378\bomega_l
379 & =  (\omega_{l0}, \omega_{l1}, \omega_{l2}, \omega_{l3}, \omega_{l4}, \omega_{l5}) = \\
380 & =  (\xi_{yz},\xi_{zx},\xi_{xy},\xi_{wx},\xi_{wy},\xi_{wz})
381\end{array}
382\label{eq:plucker_coef_def}
383\end{equation}
384
385Substituting Eq.~\ref{eq:plucker_coords} into Eq.~\ref{eq:plucker_coef_def}
386we get:
387
388\begin{equation}
389\begin{array}{l}
390\omega_{l0} = \pi_{l3} \\
391\omega_{l1} = \pi_{l4}\\
392\omega_{l2} = \pi_{l5}\\
393\omega_{l3} = \pi_{l0}\\
394\omega_{l4} = \pi_{l1}\\
395\omega_{l5} = \pi_{l2}
396\end{array}
397\label{eq:plucker_coef}
398\end{equation}
399
400
401 The \plucker coefficients $\bomega_l$ define a {\em \plucker
402 hyperplane} $\pplane_l$. We will use the notation of a \plucker
403 hyperplane $\pplane_l$ when we want to stress that the
404 corresponding \plucker coefficients $\bomega_l$ are interpreted as a
405 hyperplane in ${\cal P}^5$. In terms of \plucker points the \plucker
406 hyperplane can be expressed as:
407 
408\begin{equation}
409\label{hyperplane}
410\begin{array}{l}
411\pplane_l = \{\ppoint | \ppoint \in {\cal P}^5, \bomega_l \odot \bpi = 0\}
412\end{array}
413\end{equation}
414
415The \plucker hyperplane induces closed positive and negative halfspaces
416given as:
417
418\begin{equation}
419\begin{array}{l}
420\pplane^{+}_l = \{\ppoint | \ppoint \in {\cal P}^{5}, \bomega_l \odot \bpi \geq 0\} \\
421\pplane^{-}_l = \{\ppoint | \ppoint \in {\cal P}^{5}, \bomega_l \odot \bpi \leq 0\} \\
422\end{array}
423\label{eq:def_halfspaces}
424\end{equation}
425
426 These definitions of \plucker coordinates and coefficients follow the
427``traditional'' convention~\cite{Pu98-DSGIV}. They differ from the
428definitions used by Teller~\cite{Teller92phd} who used a permuted
429order of the coordinates. The traditional convention provides an
430elegant interpretation of \plucker coordinates that will be discussed
431in Section~\ref{sec:plucker_interp}.
432
433 If $a$ and $b$ are two directed lines, the relation $side(a,b)$ is
434defined as an inner product $\bomega_a \odot \bpi_b$ or permuted inner
435product $\bpi_a \times \bpi_b$:
436
437\begin{equation}
438\begin{array}{ll}
439  side(a,b) & = \bomega_a \odot \bpi_b = \\
440            & = \omega_{a0}\pi_{b0} + \omega_{a1}\pi_{b1} + \omega_{a2}\pi_{b2} +
441  \omega_{a3}\pi_{b3} + \omega_{a4}\pi_{b4} + \omega_{a5}\pi_{b5} = \\
442            & = \bpi_a \times \bpi_b = \\
443            & = \pi_{a0}\pi_{b3} + \pi_{a1}\pi_{b4} + \pi_{a2}\pi_{b5} +
444  \pi_{a3}\pi_{b0} + \pi_{a4}\pi_{b1} + \pi_{a5}\pi_{b2}
445\end{array}
446\label{eq:side}
447\end{equation}
448
449
450 This relation can be interpreted with the right-hand rule
451(Figure~\ref{sidepict}). If the thumb of the right hand is directed
452along line $a$, then:
453
454\begin{itemize}
455\item $side(a,b)> 0$,  if line $b$ is oriented in the direction of the fingers,
456
457\item $side(a,b) = 0$,  if lines $a$ and $b$ intersect or are parallel,
458
459\item $side(a,b) < 0$, if line $b$ points against the direction of the fingers.
460\end{itemize}
461
462\begin{figure}[htb]
463\centerline{
464  \includegraphics[width=0.8\textwidth,draft=\DRAFTFIGS]{figs/pldual}}
465\caption{The $side(a,b)$, interpreted as the right-hand rule.}
466\label{sidepict}
467\end{figure}
468
469
470\plucker coordinates have an important property: Although every
471oriented line in ${\cal R}^3$ maps to a point in \plucker coordinates,
472not every tuple of six real numbers corresponds to a real line. Only
473the points $\ppoint \in {\cal P}^5$ \plucker coordinates of which
474satisfy the condition
475
476\begin{equation}
477\bpi \odot \bpi = 0 \qquad \equiv \qquad \pi_{0}\pi_{3} + \pi_{1}\pi_{4} + \pi_{2}\pi_{5} = 0,
478\label{eq:plucker_quadric}
479\end{equation}
480
481represent real lines in ${\cal R}^3$. All other points correspond to
482lines which are said to be {\em imaginary}. The set of points in
483${\cal P}^5$ satisfying Eq.~\ref{eq:plucker_quadric} forms a 4D
484hyperboloid of one sheet called the {\em \plucker quadric}, also known
485as the {\em Klein quadric} or the {\em Grassman manifold}
486(see Figure~\ref{quadric}).
487
488
489\begin{figure}[htb]
490\medskip
491\centerline{
492  \includegraphics[width=0.65\textwidth,draft=\DRAFTFIGS]{figs/reallin}}
493\caption{Real lines map on points on the Pl\"{u}cker quadric.}
494\label{quadric}
495\end{figure}
496
497The six \plucker coordinates of a real line are not
498independent. Firstly, they describe an oriented projective space,
499secondly, they must satisfy the
500equation~\ref{eq:plucker_quadric}. Thus there are four degrees of
501freedom in the description of a 3D line, which conforms with the
502classification from Chapter~\ref{chap:overview}.
503
504 \plucker coordinates allow to detect an incidence of two lines by
505computing an inner product of a homogeneous point (mapping of one
506line) with a hyperplane (mapping of the other). Lines $l$ and $l'$
507intersect or are parallel (i.e. meet at infinity) if and only if
508$\ppoint_l \in \pplane_{l'}$, i.e. $side(l, l') = 0$. Note that according
509to ~\ref{eq:plucker_quadric} any line always meets itself.
510
511
512\subsection{Geometric interpretation of \plucker coordinates}
513\label{sec:plucker_interp}
514
515For a better understanding of \plucker coordinates it is natural to
516ask how each individual \plucker coordinate is related to the geometry
517of the corresponding line. The \plucker coordinates of a given line
518can be divided to the {\em directional} and the {\em locational}
519parts. The directional part encodes the direction of the line, the
520locational part encodes the position of the line. Given \plucker
521coordinates $\bpi_l$ of a line $l$ we can write:
522
523\begin{equation}
524\begin{array}{lll}
525\mbi{d}_l & = (\pi_{l0}, \pi_{l1}, \pi_{l2}), \\
526\mbi{l}_l & = (\pi_{l3}, \pi_{l4}, \pi_{l5}), \\
527\end{array}
528\end{equation}
529
530where $\mbi{d}_l$ is the {\em directional vector} of $l$ and $\mbi{l}_l$
531is the {\em locational vector} of $l$. The \plucker coordinates
532$\bpi_l$ and the \plucker coefficients $\bomega_l$ can be expressed as:
533
534
535\begin{equation}
536\begin{array}{ll}
537\bpi_l &= [\mbi{d}_l; \mbi{l}_l],\\
538\bomega_l &= [\mbi{l}_l; \mbi{d}_l].
539\end{array}
540\label{eq:rot3_locdir}
541\end{equation}
542
543
544\subsubsection{Extracting a point}
545
546Often we need to describe a line using a parametric representation by
547means of an {\em anchor point} and a directional vector. Given a line
548$l$ the directional vector $\mbi{d}_l$ is embedded in the \plucker
549coordinates of $l$ (see Eq.~\ref{eq:rot3_locdir}). The anchor point
550$\mbi{a}_l$ can be computed as:
551
552\begin{equation}
553\mbi{a}_l = (a_x, a_y, a_z) = \frac{\mbi{d}_l \times \mbi{l}_l}{\parallel \mbi{d}_l \parallel ^2}.
554\end{equation}
555 
556
557\subsubsection{Computing the distance}
558
559The distance between two lines $l$ and $l'$ can be expressed
560using their anchor points and the directional vectors:
561
562\begin{equation}
563  dist(l, l') = { | (\mbi{a}_l - \mbi{a}_{l'}) \cdot (\mbi{d}_l \times
564\mbi{d}_{l'}) | \over \parallel \mbi{d}_l \times \mbi{d}_{l'} \parallel }.
565\end{equation}
566
567
568The distance is the length of the projection of the line segment
569$\mbi{a}_l,\mbi{a}_{l'}$ onto the direction $\mbi{d}_l \times
570\mbi{d}_{l'}$.
571
572
573
574%%%%%%%%%%%%%%%%%%%%%%
575
576\section{Visual events}
577
578\label{sec:events}
579
580This section discusses visual events occurring in polygonal
581scenes~\cite{Gigus90}. We will focus on the boundaries of visual
582events and their relation to \plucker coordinates. The understanding
583of the  visual events helps to comprehend the complexity of the
584from-region visibility in 3D.
585
586 Any scene can be decomposed into regions from which the scene has a
587topologically equivalent view~\cite{Gigus90}. Boundaries of such
588regions correspond to {\em event surfaces}. Crossing an event surface
589causes a {\em visual event}, i.e. a change in the topology of the view
590(visibility map). In polygonal scenes there are three types of event
591surfaces~\cite{Gigus90}:
592
593\begin{itemize}
594  \item {\em vertex-edge} (VE) events involving an edge and a vertex
595  of two distinct polygons.
596  \item {\em edge-edge-edge} (EEE) events involving three edges of
597  three distinct polygons.
598  \item {\em supporting} events corresponding to supporting planes of
599  scene polygons. The supporting event can be seen as a degenerated
600  case of VE or EEE events.
601\end{itemize}
602
603The VE events correspond to planes, the EEE events in general form
604quadratic surfaces. The definitions assume that the scene polygons are
605in general non-degenerate position. In real world scenes the polygons
606or their edges polygons can be variously aligned. In such a case these
607definitions of visibility events form minimal sets of edges and
608vertices defining an event. For example a VE event can involve a
609vertex and several edges of scene polygons (see
610Figure~\ref{fig:degen_event}).
611
612\begin{figure}[htb]
613\centerline{
614  \includegraphics[width=0.45\textwidth,draft=\DRAFTFIGS]{figs/ve_degen}}
615\caption{Degenerated VE event. The VE event is induced by a vertex and
616three edges of scene polygons.}
617\label{fig:degen_event}
618\end{figure}
619
620
621 The intersections of event surfaces correspond to {\em extremal
622lines}~\cite{Teller92phd}. An extremal line intersects four edges of
623some scene polygons. There are four types of extremal lines:
624vertex-vertex (VV) lines, vertex-edge-edge (VEE) lines,
625edge-vertex-edge (EVE) and quadruple edge (4E) lines. Imagine
626``sliding'' an extremal line (of any type) away from its initial
627position by relaxing exactly one of the four edge constraints
628determining the line. The section of the event surface swept out by
629the sliding line is called the {\em swath}.  A swath is either planar
630if it corresponds to a VE event surface or a regulus if it is embedded
631in an EEE event surface.
632
633Figure~\ref{swaths}-(a) shows an extremal VV line tight on four edges
634A,B,C, and D. Relaxing constraint C yields a VE (planar) swath defined
635by A,B, and D. When the sliding line encounters an obstacle (edge E) it
636terminates at a VV extremal line defined by A,B,D, and
637E. Figure~\ref{swaths}-(b) depicts an extremal 4E line tight on the
638mutually skew edges A,B,C, and D. Relaxing constraint A produces an EEE
639event surface that is a regulus intersecting B,C, and D. When the
640sliding line encounters edge E the swath terminates at an VEE extremal
641line.
642
643\begin{figure}[htb]
644\centerline{
645  \includegraphics[width=0.75\textwidth,draft=\DRAFTFIGS]{figs/swaths}}
646\centerline{\small
647{\bf (a)}\hspace{0.3\textwidth} {\bf (b)}
648\hspace{0.2\textwidth}}
649\caption{Swaths of event surfaces. (a) VE swath. (b) EEE swath. }
650\label{swaths}
651\end{figure}
652
653
654\subsection{Visual events and \plucker coordinates}
655
656\plucker coordinates allow an elegant description of event surfaces.
657An event surface can be expressed as an intersection of three \plucker
658hyperplanes, and thus avoiding explicit treatment of quadratic
659surfaces. The non-linear EEE surfaces correspond to curves embedded in
660the intersection of the \plucker hyperplanes.
661
662Let ${\cal H}$ be an arrangement~\cite{dcg-handbook} of hyperplanes in
663${\cal P}^5$ that correspond to \plucker coefficients of edges of the
664scene polygons. The intersection of the arrangement ${\cal H}$ and the
665\plucker quadric yields all visual
666events~\cite{Teller92phd,p-rsls-97,Pu98-DSGIV}.
667
668An extremal line $l$ intersects four generator edges. Consequently,
669the corresponding \plucker point $\ppoint_l$ lies on four \plucker
670hyperplanes.  In 5D the four hyperplanes define an edge of the
671arrangement ${\cal H}$. Thus, we can find all extremal lines of a
672given set of polygons by examining the edges of ${\cal H}$ for
673intersections with the \plucker quadric~\cite{Pu98-DSGIV}.
674
675
676Consider the situation depicted in Figure~\ref{swaths}. In line space
677the event surfaces correspond to curves embedded in the \plucker
678quadric. In general these curves are conics defined by an intersection
679of the 2D-faces of ${\cal H}$ with the \plucker quadric (see
680Figure~\ref{5Dswaths}).
681
682\begin{figure}[htb]
683\centerline{
684  \includegraphics[width=0.6\textwidth,draft=\DRAFTFIGS]{figs/ipswaths}}
685\caption{3D swaths correspond to conics on the Pl\"ucker quadric.}
686\label{5Dswaths}
687\end{figure}
688
689
690
691\section{Lines intersecting a polygon}
692
693\label{sec:rot3d_singlepoly}
694
695 \plucker coordinates provide a tool to map lines from primal space to
696points in line space. This mapping allows to perform operations of
697sets of lines using set theoretical operations on the corresponding
698sets of points. In polygonal scenes the {\em elementary set of lines}
699is formed by lines intersecting a given polygon.
700
701
702 Assume that a convex polygon $P$ is defined by edges $e_i, 0\leq i <
703n$ that are oriented counterclockwise. The set of lines ${\cal L}_P$
704intersecting the polygon that are oriented in the direction of the
705polygon's normal satisfies:
706
707
708\begin{equation}
709{\cal L}_P = \{ l |  l \in (R^3, R^3), side(\bpi_l, \bpi_{e_i}) \leq 0, \forall i \in \langle 0,n) \},
710\label{eq:halfspaces}
711\end{equation}
712
713where $\bpi_l$ are \plucker coordinates of line $l$ and $\bpi_{e_i}$ are
714\plucker coordinates of $i$-th edge of the polygon. Substituting the
715Eq.~\ref{eq:side} and rewriting the equation in terms of a set of
716\plucker points we get:
717
718\begin{equation}
719\begin{array}{ll}
720{\cal F}_P & = \{ \ppoint | \ppoint \in {\cal P}^5, \bpi \times \bpi_{e_i} \leq 0, \forall i \in \langle 0,n) \} = \\
721           & = \{ \ppoint | \ppoint \in {\cal P}^5, \bpi \odot \bomega_{e_i} \leq 0, \forall i \in \langle 0,n) \},
722\end{array}
723\label{eq:feasible}
724\end{equation}
725
726where ${\cal F}_P$ is a set of {\em feasible \plucker points} for
727polygon $P$. Substituting Eq.~\ref{eq:def_halfspaces}
728into~\ref{eq:feasible} we obtain:
729
730\begin{equation}
731\begin{array}{ll}
732{\cal F}_P & = \{ \ppoint | \ppoint \in {\cal P}^5,  \bpi \in \pplane^-_{e_i}, \forall i \in \langle 0,n) \}
733\end{array}
734\label{eq:intersection}
735\end{equation}
736
737Thus the set of feasible \plucker points is defined by an intersection
738of halfspaces defined by the \plucker hyperplanes corresponding to edges of the
739polygon. The set of {\em stabbers} ${\cal S}_P$ is then defined as an
740intersection of ${\cal F}_P$ with the \plucker quadric:
741
742\begin{equation}
743{\cal S}_P = \{ \ppoint | \ppoint \in {\cal F}_P, \bpi \odot \bpi  = 0 \}.
744\end{equation}
745
746The stabbers are \plucker points corresponding to the real lines
747intersecting the polygon that are oriented in the direction of the
748normal. Similarly we can define the sets of {\em reverse feasible
749\plucker points} ${\cal F}^-_P$ and {\em reverse stabbers} ${\cal
750S}^-_P$ that correspond to opposite oriented lines intersecting the
751polygon:
752
753\begin{equation}
754\begin{array}{ll}
755{\cal F}^-_P  & = \{ \ppoint | \ppoint \in {\cal P}^5, \ppoint \in \pplane^+_{e_i}, \forall i \in \langle 0,n) \} \\
756{\cal S}^-_P  & = \{ \ppoint | \ppoint \in {\cal F}^-_P, \bpi \odot \bpi  = 0 \}.
757\end{array}
758\end{equation}
759
760
761
762
763\section{Lines between two polygons}
764\label{sec:rot3d_twopoly}
765
766 The above presented definitions of elementary line sets  allow to
767handle visibility computations by means of set operations on the sets
768of feasible \plucker points.  Visibility between two polygons $P_j$
769and $P_k$ can be determined by constructing an intersection of
770feasible sets of the two polygons ${\cal F}_{P_j}$ and ${\cal
771F}_{P_k}$ and subtracting all feasible sets of polygons lying between
772$P_j$ and $P_k$. To obtain the set of unoccluded stabbers we intersect
773the resulting feasible set with the \plucker quadric.
774
775Further in this chapter we restrict our discussion to visibility from
776a given {\em source polygon} $P_S$. Given any {\em occluder polygon}
777$P_j$ we first describe lines intersecting both $P_S$ and $P_j$. Lines
778between $P_S$ and  $P_j$ can be described by an intersection of their
779feasible line sets:
780
781\begin{equation}
782{\cal F}_{P_SP_j} = {\cal F}_{P_S} \cap {\cal F}_{P_j}
783\end{equation}
784
785and thus
786
787\begin{equation}
788{\cal S}_{P_SP_j} = {\cal S}_{P_S} \cap {\cal S}_{P_j}.
789\end{equation}
790
791 The feasible \plucker points are defined by an intersection of
792halfspaces corresponding to edges of $P_S$ and $P_j$. These halfspaces
793define a {\em blocker polyhedron} $B_{P_SP_j}$ that is described in
794the next section.
795
796
797\subsubsection{Blocker polyhedron}
798
799 The blocker polyhedron describes lines intersecting the source
800 polygon and the given occluder.  The blocker polyhedron can be seen
801 as an extension of the blocker polygon discussed in
802 Chapters~\ref{chap:rot2d} and~\ref{chap:rot3d} for the from-region
803 visibility in 3D scenes. The blocker polyhedron is a 5D polyhedron in
804 a 5D projective space.  To avoid singularities in the projection from
805 ${\cal P}^5$ to ${\cal R}^5$ the polyhedron can be embedded in ${\cal
806 R}^6$ similarly to the embedding of blocker polygon in ${\cal R}^3$
807 (see Section~\ref{sec:blocker_polygon}). Then the polyhedron actually
808 represents a 6D pyramid with an apex at the origin of ${\cal R}^6$.
809
810
811\subsubsection{Cap planes}
812
813The blocker polyhedron is defined by an intersection of halfspaces
814defined by \plucker planes that are mappings of edges of the source
815polygon and the occluder. As stated above the blocker polyhedron
816represents the set of feasible \plucker points ${\cal F}_{P_SP_j}$
817including points not intersecting the \plucker quadric that correspond
818to imaginary lines. We bound the polyhedron by {\em cap planes}
819aligned with the \plucker quadric so that the resulting polyhedron is
820a tighter representation of the stabbers ${\cal S}_{P_SP_j}$. We need
821to ensure that the resulting polyhedron fully contains the stabbers
822${\cal S}_{P_SP_j}$, i.e. contains the cross-section of the \plucker
823quadric and ${\cal F}_{P_SP_j}$.
824
825The cap planes provide the following benefits:
826
827\begin{itemize}
828\item The computation is localized to the proximity of the \plucker
829quadric. This reduces the combinatorial complexity of data structure
830representing an arrangement of the blocker polyhedra.
831
832\item The blocker polyhedron is always bounded. Although the set of
833  lines between two convex polygons is bounded, the set of feasible
834  \plucker points can be unbounded at the ``direction'' of imaginary
835  lines. Adding the cap planes we make sure that the polyhedron is
836  bounded, which allows its easier treatment. By using the cap planes
837  we avoid the handling of very oblong, almost unbounded polyhedra,
838  which improves numerical stability of a floating point
839  implementation of the algorithm.
840\end{itemize}
841
842
843 We used two cap planes to bound the polyhedron, one for each side of
844the \plucker quadric (a side is given by the sign of $\bpi \odot
845\bpi$). The cap planes are computed as tangents to the \plucker
846quadric at the center of the set of stabbers ${\cal S}_{P_SP_j}$. The
847planes are translated each at the opposite direction making sure that
848they include the whole set ${\cal S}_{P_SP_j}$.
849
850
851
852\subsection{Intersection with the \plucker quadric}
853\label{sec:stabbers}
854
855Given a blocker polyhedron representing the set of feasible lines
856${\cal F}_{P_SP_j}$ we can compute an intersection of the edges of the
857polyhedron with the \plucker quadric to determine the set of extremal
858lines bounding the set of stabbers ${\cal S}_{P_SP_j}$. An
859intersection of an edge of the blocker polyhedron with the \plucker
860quadric results in at most two {\em extremal \plucker points} that
861correspond extremal lines\footnote{Neglecting the case that the whole
862edge is embedded in the \plucker quadric, which results in infinite
863number of extremal lines.}. Given an edge of the blocker polyhedron
864the intersection with the \plucker quadric is computed by solving the
865quadratic equation (Eq.~\ref{eq:plucker_quadric}). A robust algorithm
866for computing this intersection was developed by
867Teller~\cite{TH83}.
868
869
870Intersecting all edges of the blocker polyhedron with the \plucker
871quadric yields all extremal lines of ${\cal
872S}_{P_SP_j}$~\cite{Teller:1992:CAA,Pu98-DSGIV}. See
873Figure~\ref{fig:rot3_visrays} for an example of extremal lines
874computed for the given source polygon and a set of three occluders.
875
876
877\begin{figure}[htb]
878\centerline{
879  \includegraphics[width=0.5\textwidth,draft=\DRAFTIMAGES]{images/rot3_visrays}}
880\caption{Extremal lines for the given source polygon (yellow) and three occluders.}
881\label{fig:rot3_visrays}
882\end{figure}
883
884 The intersection of the 2D faces of the blocker polyhedron with the
885\plucker quadric yields swaths of event surfaces of the set of
886stabbers ${\cal S}_{P_SP_j}$~\cite{Teller92phd}. In general the
887intersection results in 1D conics.
888
889 We can avoid the explicit treatment of conics in 5D by computing the
890local topology of the edges of the blocker polyhedron and constructing
891the swaths in primal space between the topologically connected
892extremal lines~\cite{Teller92phd}. The local topology of an extremal
893\plucker point is given by connections with extremal \plucker points
894embedded in the same 2D face of the blocker polyhedron.  A 2D face of
895the blocker polyhedron is given by three \plucker hyperplanes. Thus
896the pairs of extremal \plucker points defined by the subset of the
897same three \plucker hyperplanes define a swath.
898
899
900
901For solution of some from-region visibility problems (e.g. PVS
902computation, region-to-region visibility) the event swaths need not be
903reconstructed. For example the visibility culling algorithm that will
904be discussed in Section~\ref{sec:rot3pvs} only computes extremal
905\plucker points and uses them to test an existence of a set of
906stabbers of a given size.
907
908
909\subsection{Size of the set of lines}
910
911\label{sec:size_measure}
912
913Computing a size measure of a given set of lines is useful for most
914visibility algorithms. The computed size measure can be used to drive
915the subdivision of the given set of lines or to bound the maximal
916error of the algorithm. An analytic algorithm can use the computed
917size measure for thresholding by a given $\epsilon$-size to discard
918very small line sets.  A discrete algorithm can use the size measure
919to determine the required density of sampling.
920
921The size of a set of lines for the from-point visibility can be
922formulated easily: the size is given by the area of the intersection
923of the line set with a plane. This corresponds to quantifying
924visibility of an object according to its projected area. Such a size
925is determined in the solution space (viewport). Alternatively we could
926use a ``viewport independent measure'' given by a solid angle formed by
927the visible part of an object. The size measure for the from-region
928visibility problems is more complicated for the following reasons:
929
930\begin{itemize}
931\item The domain of the solution space is four-dimensional.
932\item The solution space of the from-region visibility algorithm
933  generally does not correspond to the solution space of the
934  application. For example, a visible surface algorithm using a
935  precomputed PVS works in a 2D domain induced by the given viewport.
936\end{itemize}
937
938
939\subsubsection{General size measure}
940
941A size of a set of lines for the from-region visibility can be
942computed by evaluating a 4D integral. Using \plucker coordinates we
943can compute a volume of the 4D hyper-surface corresponding to the
944given set of lines. The volume however depends on a way of projecting
945the blocker polyhedron from ${\cal P}^5$ to ${\cal R}^5$. This
946projection has a similar role as the selection of the viewport for the
947from-point visibility problem. We can project the blocker polyhedron
948from ${\cal P}^5$ to ${\cal R}^5$ by projecting it to a 5D hyperplane
949defined by certain reference direction, e.g. the ``center-line'' of
950the given set of lines. Pu proposed a different size measure based on
951measuring the {\em angular spread} and the {\em distance} between
952lines~\cite{Pu98-DSGIV}. Both these quantities can be evaluated in
953terms of \plucker coordinates of the set of extremal lines of the
954given line set.
955
956
957\subsubsection{Size measure for the PVS computation}
958
959 It can be difficult to relate the size measures described above to
960the domain of the result of a subsequently applied visibility
961algorithm. We need a simple scheme that fits to the context of the
962target application.  In this section we suggest a size measure
963designed for the PVS computation. When computing a PVS we are
964interested in measuring the size of the set of unoccluded lines
965(stabbers) between the source polygon $P_S$ and a given scene
966polygon. If this size is below an $\epsilon$-threshold, we can
967possibly exclude the polygon from the PVS.  We suggest to use an
968estimate of the minimal angle between the stabbers at a point inside
969$P_S$. The idea is to estimate the minimal projected diameter of a
970polygon visible through the given set of lines from any point inside
971$P_S$. This estimate can be used to bound a maximal error of an image
972synthesized with respect to any viewpoint inside $P_S$ for the case that
973the corresponding set of lines is neglected.
974
975%%  The size measure approximates the minimal spatial angle given by a
976%% cross-section of the given set of lines parallel to the source polygon
977%% $P_S$ and the center of $P_S$.
978
979Given a blocker polyhedron ${\cal F}_{P_SP_j}$  the proposed size
980measure can be evaluated as follows:
981
982\begin{enumerate}
983
984\item
985 Compute the extremal lines of the corresponding set of stabbers ${\cal
986S}_{P_SP_j}$ as described in Section~\ref{sec:stabbers}.
987
988\item For each polygon edge $e_i$ bounding the stabbers
989  determine an extremal line $l_{mi}$ with a maximal distance from the
990  edge.
991 
992\item For each edge $e_i$ compute a shortest line segment $z_i$
993  connecting $e_i$ and $l_{mi}$.  The length of this line segment is
994  then scaled according to its distance from the source polygon,
995  i.e. we compute an angle $\alpha_i$ between the lines connecting the
996  center of the source polygon and the endpoints of $z_i$.
997 
998\item Select a minimal angle $\alpha_m$ of all $\alpha_i$ as the
999estimate of the size of the given line set.
1000
1001\end{enumerate}
1002
1003The evaluation of the size measure is depicted in
1004Figure~\ref{fig:linesize}.
1005
1006\begin{figure}[htb]
1007\centerline{
1008  \includegraphics[width=0.4\textwidth,draft=\DRAFTFIGS]{figs/linesize}}
1009\caption{A 2D example of evaluation of the size of a set of lines. The three
1010  line segments
1011  $z_1$, $z_2$ and $z_3$ maximize the distance of the corresponding
1012  occluder edges from the extremal lines. The line segment $z_3$ spans
1013  a minimal angle $\alpha_m$ with respect to the center of the source
1014  polygon $P_S$.}
1015\label{fig:linesize}
1016\end{figure}
1017
1018 The angle $\alpha_m$ can be related to the angular resolution of the
1019synthesized image. Given the resolution of the image we can threshold
1020``small'' line sets with $\alpha_m$ below the corresponding angular
1021threshold to achieve a sub-pixel precision of the rendering algorithm.
1022This measure can also be applied to deal with the finite precision of
1023the floating point arithmetics by using a small $\epsilon$-threshold
1024to handle numerical inaccuracies.
1025
1026
1027\section{Summary}
1028
1029 In this chapter we discussed the relation of sets of lines in 3D and
1030the polyhedra in \plucker coordinates. We proposed a general size
1031measure for a set of lines described by a blocker polyhedron and a
1032size measure designed for the computation of PVS.
1033
Note: See TracBrowser for help on using the repository browser.