Application to Computer Graphics

Computer graphics deals with images displayed on a computer screen, and so arises in a variety of applications, ranging from word processors, to Star Wars animations, to video games, to wire-frame images of an airplane. These images consist of a number of points on the screen, together with instructions on how to fill in areas bounded by lines and curves. Often curves are approximated by a set of short straight-line segments, so that the curve is specified by a series of points on the screen at the end of these segments. Matrix transformations are important here because matrix images of straight line segments are again line segments.

Note that a color image requires that three images are sent, one to each of the red, green, and blue phosphorus dots on the screen, in varying intensities.

Consider displaying the letter . In reality, it is depicted on the screen, as in the figure below, by specifying the coordinates of the 11 corners and filling in the interior.

For simplicity, we will disregard the thickness of the letter, so we require only five coordinates as in the figure below.

This simplified letter can then be stored as a data matrix

where the columns are the coordinates of the vertices. Then if we want to transform the letter by a matrix , we left-multiply this data matrix by (the effect is to multiply each column by and so transform each vertex).

For example, we can slant the letter to the right by multiplying by a horizontal shear matrix (See Formula form:shears.) The result is the letter with data matrix

which is shown in the figure below.

If we want to make this slanted matrix narrower, we can now apply a scaling matrix that shrinks the -coordinate by . (See Formula form:horvertscaling.) The result is the composite transformation

which is drawn in the figure below.

On the other hand, we can rotate the letter about the origin through (or ) by multiplying by the rotation matrix (See Formula form:rotation.) This gives

and is plotted in the figure below.

This poses a problem: How do we rotate about a point other than the origin? It turns out that we can do this when we have solved another more basic problem. It is clearly important to be able to translate a screen image by a fixed vector , that is apply the transformation given by for all in . The problem is that these translations are not matrix transformations because they do not carry to (unless ). (See Practice Problem prob:translation_does_not_work.) However, there is a clever way around this.

The idea is to represent a point as a column , called the homogeneous coordinates of . Then translation by can be achieved by multiplying by a matrix:

Thus, by using homogeneous coordinates we can implement the translation in the top two coordinates. At the same time, matrix transformations we performed earlier can still be accomplished using homogeneous coordinates. For instance, the matrix transformation induced by is given by a matrix: So everything can be accomplished at the expense of using matrices and homogeneous coordinates.

It is interesting to examine the geometric implications of homogeneous coordinates. All points of the form , originally located in the -plane in , now have the form and are located in a horizontal plane in . What we perceive as a translation in the horizontal plane , is actually a shear in . This is similar to how horizontal shears in affect points along the line : all such points move a fixed distance to the left or to the right.

This discussion merely touches the surface of computer graphics, and the reader is referred to specialized books on the subject. Realistic graphic rendering requires an enormous number of matrix calculations. In fact, matrix multiplication algorithms are now embedded in microchip circuits, and can perform over 100 million matrix multiplications per second. This is particularly important in the field of three-dimensional graphics where the homogeneous coordinates have four components and matrices are required.

Practice Problems

Consider the letter below.

Find the data matrix for the letter obtained by:

(a)
Rotating the letter through about the origin.
(b)
Rotating the letter through about the point .

Click the arrow to see the answer.

Find the matrix for reflecting in the line . Use as direction vector for the line.
Find the matrix for rotating through the angle about the point .
Find the reflection of the point in the line in if:
(a)
(b)

Click the arrow to see the answer.

(c)
What about ? Explain.
See Example exa:013322.