MCIS 625: Computer Graphics
Winter 2004

WEEK 5

Instructor: Dr. Michael Laszlo


Assignment
  1. Please review my slide set on geometric transformations.
  2. Optional reading assignment: Chapter 6 of Foley, et al.

Transformations
Geometric transformations play a multi-faceted role in computer graphics. Transformations are used in modeling, whereby graphical objects are constructed and combined to form scenes of arbitrary complexity. They are also used in the viewing of 3D scenes. Here, a synthetic camera is situated in space, and the view from the camera is obtained through a series of 3D transformations (including projection from 3D to 2D). Transformations are also used in creating animations, to specify the motion of the synthetic camera and of objects, lights, textures, and other scene elements. Transformations play other roles in computer graphics as well.

Understood most simply, geometric transformations are used to modify the shape, size, and orientation of graphical objects. The basic transformations are translation, scaling, and rotation. Although transformations make sense in any number of dimensions, the following assumes 2D transformations in the plane:

Transformations are generally done in a series, one after another. The result of a series of transformations is itself a transformation. For example, suppose we wish to rotate an object by θ degrees around some point (x,y) other than the coordinate system's origin. To do so, we may carry out the following series of three transformations: The net result of this series of three transformations is a transformation that represents rotation by θ degrees aound the point (x,y).

This kind of series of transformations occurs very often in modeling, viewing, and animation. Accordingly, it is useful to be able to able to represent the resulting net transformation—the result of any series of transformations—the same way we represent the basic tranformations of translation, scaling, and rotation. This uniformity of representation means that we are able to apply a transformation in precisely the same way, and with the same degree of efficiency, whether that transformation is a basic one, or one that arises from a series of any number of other transformations.

A 2D transformation is represented by a 3x3 matrix of real numbers. To transform a point (x,y) in the plane, we represent the point in homogeneous coordinates by appending the value one as its third coordinate: (x,y,1). Then we premultiply the resulting 3-component point by the 3x3 matrix that represents the given transformation. The result is a new point (x',y',1) that is the new position of the original point in homogeneous coordinates. Details are provided in this week's reading assignment.

This arrangement may appear unnecessarily complicated. Why not use a 2x2 matrix to represent a transformation, and simply premultiply this matrix by the point to be transformed to obtain a new 2-component point? Why must we resort to homogeneous coordinates? The reason is that, although basic rotation and scaling can be represented by 2x2 matrices, translation cannot. Translation in 2D requires the use 3x3 matrices and homogeneous coordinates. The use of homogeneous coordinates satisfies our requirement that any transformation be represented the same way.

Note that general rotation around an arbitrary point (x,y) is represented by a 3x3 matrix, as we would expect. (The actual matrix is labeled (5.30) on page 176 of our text.) This matrix is obtained by multiplying together the three matrices corresponding to the three transformations listed in the series above:

T(x,y)×R(θ)×T(-x,-y)
In other words, the matrices are composed. Similarly, we sometimes speak of composing transformations.

Because matrix multiplication is associative, either of the two multiplications can be carried out first; that is,

(T(x,y)×R(θ))×T(-x,-y) = T(x,y)×(R(θ)×T(-x,-y))
However, because matrix multiplication is not commutative, the order of the matrices must remain unchanged.

Transformations in 3D are represented by 4x4 matrices, and points in 3D are appended by a one: (x,y,z,1). This is analogous to 2D transformations, one dimension higher. However, in 3D we have three basic rotations, one around each of the three major axes x, y, and z.


[ Home | Course | Syllabus ]