3.6.1 2D Transformation

In Chapter 3 you learned that you need to convert from one coordinate system to another in order to ultimately display a picture on the TV screen. Now this chapter shows you how to actually do the coordinate system transformations by using matrix calculations.

Usually, 3x3 matrices are used for two-dimensional coordinate transformations and 4x4 matrices are used for three-dimensional coordinate transformations. In addition, to display the coordinates of vertices, we show you how to use the two-dimensional vector [x y 1] and the three-dimensional vector [x y z 1].

In general, a matrix like the following is used for two-dimensional coordinate transformations:

During the transformation process three different variations of this conversion matrix are created to apply scaling information, translation information, and rotation information:

As you can see, the three conversion matrices hold the information needed to specify scaling, translating and rotating.