next up previous contents
Next: 11.2.2.2 Using Dual-Paraboloid Maps Up: 11.2.2 Dual-Paraboloid Environment Mapping Previous: 11.2.2 Dual-Paraboloid Environment Mapping

11.2.2.1 The Mathematics of Dual-Paraboloid Maps

The principle that underlies paraboloid maps is the same principle that underlies a parabolic lens or satellite dish. The geometry of a paraboloid can focus rays. The paraboloid used for dual-paraboloid mapping is:

\begin{displaymath}f(x,y) = \frac{1}{2} - \frac{1}{2}(x^2 + y^2), \mbox{\hspace{.5in}} x^2 + y^2 \leq 1
\end{displaymath}

Figure 74 shows how two paraboloids can focus the entire environment surrounding a point into two images.

 

% latex2html id marker 12756
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0....
...igure \thefigure . Example Dual-Paraboloid Texture Map Images}\\
\end{tabular}}

Unlike the sphere mapping approach that the encodes the entire environment in a single texture, the dual-paraboloid mapping scheme requires two textures to store the environment, one texture for the ``front'' environment and another texture for the ``back'' environment. Importantly, the sense of ``front'' and ``back'' is completely independent of the viewer orientation. Figure 75 shows an example of two paraboloid maps. Because two textures are required, the technique must be performed in two rendering passes though this can be reduced to a single rendering pass if multitexturing is supported.

Because the math for the paraboloid is all linear (unlike the spherical basis of the sphere map), Heidrich and Seidel observe that OpenGL with its texture matrix can map a eye-coordinate reflection vector $\vec{R}$ into a 2D texture coordinate (s,t)within a dual-paraboloid map. Construct the necessary texture matrix as follows:

\begin{displaymath}\pmatrix{ s \cr t \cr 1 \cr 1 } = {\bf A} \cdot {\bf P} \cdot...
...t ({\bf M}_l)^{-1} \cdot \pmatrix{ R_x \cr R_y \cr R_z \cr 1 }
\end{displaymath}

where

\begin{displaymath}{\bf A} = \pmatrix{ \frac{1}{2} & 0 & 0 & \frac{1}{2} \cr 0 &...
...{1}{2} & 0 & \frac{1}{2} \cr 0 & 0 & 1 & 0 \cr 0 & 0 & 0 & 1 }
\end{displaymath}

is a matrix that scales an biases a 2D coordinate in the range [-1,1] to the texture image range [0,1]. And where

\begin{displaymath}{\bf P} = \pmatrix{ 1 & 0 & 0 & 0 \cr 0 & 1 & 0 & 0 \cr 0 & 0 & 1 & 0 \cr 0 & 0 & 1 & 0 }
\end{displaymath}

is a projective transform that divides by the z coordinate. This serves to flatten a 3D vector into 2D. And where

\begin{displaymath}{\bf S} = \pmatrix{ -1 & 0 & 0 & d_x \cr 0 & -1 & 0 & d_y \cr 0 & 0 & 1 & d_z \cr 0 & 0 & 0 & 1 }
\end{displaymath}

is a matrix that subtracts the supplied 3D vector from an orientation vector $\vec{d}$ that supplies a view direction. We will make $\vec{d}$ either (0,0,-1)T or (0,0,1)T depending on whether we are mapping the front or back paraboloid map respectively. Finally, the matrix $({\bf M}_l)^{-1}$is the inverse of the linear part of the current (affine) modelview matrix. The matrix $({\bf M}_l)^{-1}$ transforms a 3D eye-space reflection vector into an object-space version of the vector.


next up previous contents
Next: 11.2.2.2 Using Dual-Paraboloid Maps Up: 11.2.2 Dual-Paraboloid Environment Mapping Previous: 11.2.2 Dual-Paraboloid Environment Mapping
David Blythe
1999-08-06