next up previous contents
Next: 6.11 Rendering Text Up: 6 Texture Mapping Previous: 6.9 Transparency Mapping and   Contents


6.10 Billboards

It is often desirable to replace intricate geometry with simpler texture mapped geometry to increase realism and performance. Billboarding is a technique in which complex objects such as trees are drawn with simple planar texture mapped geometry and the geometry is transformed to face the viewer. The transformation typically consists of a rotation to orient the object towards the viewer and a translation to place the object in the correct position. For the case of the tree, an object with roughly cylindrical symmetry, an axial rotation is used to rotate the geometry for the tree, typically a quadrilateral, about the axis running parallel to the tree trunk.

For the simple case of the viewer looking down the negative $z$-axis and the up vector equal to the positive $y$-axis, the angle of rotation can be determined by computing the eye vector from the model view matrix $M$

\begin{displaymath}\vec{V}_{eye} = M^{-1} \pmatrix{ 0 \cr 0 \cr -1 \cr 0 }\end{displaymath}

and the rotation $\theta$ about the $y$ axis is computed as

\begin{eqnarray*}
\cos \theta & = & \vec{V}_{eye} \cdot \vec{V}_{front} \\
\sin \theta & = & \vec{V}_{eye} \cdot \vec{V}_{right}
\end{eqnarray*}



where

\begin{eqnarray*}
\vec{V}_{front} & = & (0, 0, 1) \\
\vec{V}_{right} & = & (1, 0, 0)
\end{eqnarray*}



Once $\theta$ is computed, construct a rotation matrix $R$ representing this rotation about the $y$-axis ($\vec{V}_{up}$). Then concatenate this rotation matrix with the modelview matrix to make a combined matrix called $MR$. Use this combined matrix to transform the billboard geometry.


% latex2html id marker 5649
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0.1...
...mall Figure \thefigure . Billboard with Cylindrical Symmetry }\\
\end{tabular}}

To handle the more general case of an arbitrary billboard rotation axis, an intermediate alignment rotation $A$ of the billboard axis into the $\vec{V}_{up}$ axis is computed as

\begin{eqnarray*}
\vec{axis} & = & \vec{V}_{up} \times \vec{V}_{billboard} \\
\...
...\vec{V}_{billboard} \\
\sin \theta & = & \Vert \vec{axis} \Vert
\end{eqnarray*}



and the matrix transformation is replaced with $MAR$. Note that the preceding calculations assume that the projection matrix contains no rotational component.

In addition to objects which are cylindrically symmetric, it is also useful to compute transformations for spherically symmetric objects such as smoke, clouds and bushes. Spherical symmetry allows billboards to rotate up and down as well as left and right, whereas cylindrical behavior only allows rotation to the left or right. Cylindrical behavior is suited to objects such as trees which should not bend backward as the viewer's altitude increases.

Objects which are spherically symmetric are rotated about a point to face the view and thus provide more freedom in computing the rotations. An additional alignment constraint can resolve this freedom. For example, an alignment constraint which keeps the object oriented in a consistent fashion, such as upright. This constraint can be enforced in object coordinates when the objective is to maintain scene realism, perhaps to maintain the orientation of plume of smoke consistently with other objects in a scene. The constraint can also be enforced in eye coordinates which can be used to maintain alignment of an object relative to the screen, for example, keeping annotations such as text aligned horizontally on the screen.

The computations for the spherically symmetric case are a minor extension of the computations for the arbitrarily aligned cylindrical case. First an alignment transformation, $A$, is computed to rotate the alignment axis onto the up vector followed by a rotation about the up vector to align the face of the billboard with the eye vector. $A$ is computed as

\begin{eqnarray*}
\vec{axis} & = & \vec{V}_{up} \times \vec{V}_{alignment} \\
\...
...\vec{V}_{alignment} \\
\sin \theta & = & \Vert \vec{axis} \Vert
\end{eqnarray*}



where $\vec{V}_{alignment}$ is the billboard alignment axis with the component in the direction of the eye direction vector removed

\begin{displaymath}\vec{V}_{alignment} = \vec{V}_{billboard} - (\vec{V}_{eye} \cdot \vec{V}_{billboard}) \vec{V}_{eye}\end{displaymath}

A rotation about the up vector is then computed as for the cylindrical case.


next up previous contents
Next: 6.11 Rendering Text Up: 6 Texture Mapping Previous: 6.9 Transparency Mapping and   Contents
2001-01-10