Computing Viewing Transforms
- NOTES:
- The GEOMETRIC MODEL is in a RIGHT-HAND world coordinate system
- The CAMERA is in a LEFT-HAND eye coordinate system
- Don't attempt to figure these out without making good sketches first
- Axis shufflers are used for two purposes: 1) to transform a coordinate
system into a right handed one and 2) to make rotation angles less than
90° to make angle computations easier
- The following transformations will transform the world coordinate system
into the eye coordinate system by acting on the coordinate system
- T1 is a translation that moves the camera location
(xc, yc, zc), specified in world coordinates,
to (0, 0, 0).
- Next, find a convenient LEFT-HANDED coordinate system whose axes are parallel to the
original coordinate system and shuffle the axes into this system with a transformation,
Ts. This would now be an eye coordinate system, but one whose ze
axis probably points in the wrong direction. Pick the axis directions so that a couple
of coordinate system rotations of less than 90° will make the ze axis
point at the "look-at" point.
- Do one or two rotations R1 and R2 as necessary to rotate
the ze axis to pass through the "look-at" point.
Make sure that the signs of the sin terms in each rotation matrix are correct.
The cannonical transformation matrices assume that
- The current coordinate system is RIGHT-HANDED
- Objects are being rotated, rather than the coordinate system
- The rotation direction is CCW
- The rotation direction is determined when standing on the positive
axis and looking through the origin at the negative part of the axis
Reversing an odd number of these 4 conditions requires the use of the matrix
inverse.
- The final transformation is T = R2R1TsT1