i
i
i
i
i
i
i
i
142 6. A Pocket 3D Theory Reference
of reference and sense of rotation, is positiv e when the camera tilts to
the right as it looks from p
o
along the x-axis.
A viewing transformation appears to operate in reverse to ordinary trans-
formations. For example, if you tilt your head to the left, the world appears
to tilt to the right. Note carefully that the angle
is positive if we are looking
down and negative if we looking up. If you prefer, you can think of as the
heading, as the pitch and as the degree of banking.
The viewing transformations are also combined in the reverse order to the
order in which a transformation is assembled for objects placed in a scene. In
that case, the rotation around the x-axis is applied first and the translation by
p
o
is applied last.
Given the parameters p
o
, , and (illustrated in Figure 6.16), the
transformation T
o
is constructed by the following algorithm:
Place observer at (0, 0, 0) with the transformation:
T
1
= a translation by −p
o
Rotate the direction of observation into the xz-plane with:
T
2
= arotationaboutz by −
Align the direction of observation to the x-axis with:
T
3
= arotationabouty by −
Straighten the camera up with transformation:
T
4
= arotationaboutx by −
Multiply the individual transformation matrices to give
one composite matrix representing the viewing transformation:
T
0
= T
4
T
3
T
2
T
1
6.6.7 Projection Transformation
After we set up a camera to record an image, the view must then be projected
onto film or an electronic sensing device. In the conventional camera, this is
done with a lens a rrangement or simply a pinhole. One could also imagine
holding a sheet of glass in front of the viewer and then having her trace on
it what she sees as she looks through it. What is drawn on the glass is what
we would like the computer to produce: a 2D picture of the scene. It’s even
shown the right way up, as in Figure 6.17.