What are 2-Dimensional Transformations?

A transformation is a change in the location, size and/or orientation of an object. Translate, scale and rotate are the three basic types of transformations. Translate repositions (moves) an object in coordinate space while scale and rotate changes the size and the orientation of the object, respectively. Scale and rotate are performed relative to the origin of the coordinate system. This means that the origin is a fixed point and does not move when scales and rotations are applied. In turn, any object containing the origin will remain at the origin when scaling and/or rotating the object.

The order in which transformations are applied to an object (the triangle in this case) is important. A translation followed by a scale, for example, will create an effect different from the one obtained by performing the scale transform first. This is due to the fixed point of the scale transformation and the triangle containing the fixed point. By performing the the scale transform first, the triangle will change size but will remain at the origin. When the translation is performed, the resized triangle is moved away from the origin. On the other hand, if we first move the triangle away from the origin, then scaling will not only resize the triangle but will also move the triangle further or closer to the origin. Similarily, applying a rotation after a translation has a different effect than rotating before translating. Again, this difference is due to the fixed point (origin) of a rotation. In either case, a rotation causes the triangle to rotate about the origin and the effect depends on whether the triangle contains the origin.

Transformations are also called change in coordinates and a tranformation performs arithmetic operations on the coordinates that define the object. Through the use of homogeneous coordinates, a 2D transformation in mathematics is represented by a 3-by-3 matrix. In particular, the two translation values (i.e., the amounts added to x and to y) will appear, respectively, as the (0,2) and (1,2) entries of the matrix. Noting that rows and columns of a transformation matrix are indexed from 0 to 2, the translation values are stored in the first two rows of the third column. The scaling values will be the (0,0) and (1,1) entries of their matrix while the values for carrying out a rotation will appear in the upper-left 2x2 matrix. (Note: when working with OpenGL, coordinates are given in 3-space and, in turn, the size of the matrices are 4-by-4.)

Through your selections and input you are composing transformations. This means, for example, if you select rotate, scale and then rotate in that order, the second rotation angle will be added to the first after scaling is applied.

The composition of two transformations, such as rotate followed by scale, is represented by the product of their respective matrices. In turn, the composite transformation matrix is applied to the vertices of an object to obtain the new (transformed) coordinates of the object. Not only can we see from the display that different effects may occur when changing the order of transformations, we can also verify this by looking at the product matrix. Try, for example, a rotation followed by a translation and then the two in reverse order after clicking on reset. Do you see the difference?