MAPaint Technical Report:
Walking Around the Statue

next up previous contents
Next: Up is Up Up: Viewing Planes Previous: Viewing Planes

Walking Around the Statue

The initial solution adopted in the 3D paint program is to always display the viewing plane ``flat'' but to orient the image as if the viewer were ``walking around'' the object. The actual displayed image is then obtained by rotating the viewed plane about an axis parallel to the line of intersection of the view plane and the ``horizontal'' which is defined to be a plane of constant z. This is depicted in figure 3 where two viewing angles are defined: the angle to the x-axis of the projection of the viewing direction onto the horizontal, $\theta $, and the angle from the viewing direction to the z-axis, $\phi$. These are the usual spherical coordinate angles and are known under many aliases azimuth and declination or pitch and yaw. Only two angles are required to define the viewing direction and the third Eulerian angle is determined by using the rule outlined above. It can be seen for example that a y-z plane is displayed with y' = y and x' = z, and the x-z plane is displayed with x' = x and y' = -z. It is straightforward to show that the Euler angles defined using $\theta $, $\phi$ and rotation about the line of intersection with the horizontal are
$\displaystyle \xi$ = $\displaystyle \theta,$ (7)
$\displaystyle \eta$ = $\displaystyle \phi \;\;\mbox{and}$ (8)
$\displaystyle \zeta$ = $\displaystyle -\theta.$ (9)

Substituting these into equation 3.1 yields

\begin{displaymath}R = \left( \begin{array}{ccc}
cos^2(\theta)cos(\phi) + sin^2(...
...(\phi) & -sin(\theta)sin(\phi) & cos(\phi)
\end{array} \right)
\end{displaymath} (10)

For each new view it is necessary to calculate the corresponding point in the reference image for each point on in the view plane. This is done by defining a set of look-up tables so that the trigonometric functions are only calculated once for each viewing direction. Because the transform angles can be arbitrary floating point numbers it is necessary to calculate the corresponding point in the reference image in real (floating point) coordinates. This means that 6 LUT's are required namely a vector LUT for x' and y'. These LUT's, the maximum values for x', y' and z', the view angles, fixed point and distance are each stored in the ViewStruct data-structure held with each view window and are used for updating values as the distance or other parameters are modified.


next up previous contents
Next: Up is Up Up: Viewing Planes Previous: Viewing Planes

Richard Baldock
1998-06-05