Multiplying transformation matrix values directly offers the second fastest performance, yet can still respond to a variety of desired transformations. As many transformation matrixes as needed can be multiplied together. If the application is concatenating the matrixes itself, it is responsible for preventing the accumulated transformation side effects.

For example, to rotate an object counterclockwise about the point (p,q) using a single transformation call requires three transformations to be concatenated. When the application is specifying each transformation, step-by-step, the sequence of actions would be:

The individual matrixes are:

Ú           ¿ Ú                              ¿ Ú         ¿
³  1   0  0 ³ ³  cos (theta)  sin (theta)  0 ³ ³ 1  0  0 ³
³  0   1  0 ³ ³ -sin (theta)  cos (theta)  0 ³ ³ 0  1  0 ³
³ -Tx -Ty 1 ³ ³   0            0           1 ³ ³ Tx Ty 1 ³
À           Ù À                              Ù À         Ù

The matrix for the concatenated transformation is produced incrementally. That is, two adjacent matrixes are multiplied to produce a single matrix, which is then multiplied with the third matrix. You can begin by multiplying either the first two matrixes or the second two matrixes. If you start by multiplying matrixes 2 and 3 together, the resulting matrix is:

          Ú                              ¿
          ³  cos (theta)  sin (theta)  0 ³
          ³ -sin (theta)  cos (theta)  0 ³
          ³   Tx           Ty          1 ³
          À                              Ù

This matrix is multiplied with the first matrix to produce the matrix for rotating an object at the point (p,q):

          Ú                              ¿
          ³  cos (theta)  sin (theta)  0 ³
          ³ -sin (theta)  cos (theta)  0 ³
          ³   a            b           1 ³
          À                              Ù

where:

a = (-Txcos (theta) + Tysin (theta) + Tx)

and

b = (-Txsin (theta) - Tycos (theta) + Ty)

If an application were performing the concatenation for a scaling operation, again it would have to specify the transformation step-by-step. The sequence of actions would be:

Here are the three matrixes required to obtain this effect:

Ú           ¿ Ú            ¿ Ú         ¿
³  1   0  0 ³ ³  Sx  0   0 ³ ³ 1  0  0 ³
³  0   1  0 ³ ³  0   Sy  0 ³ ³ 0  1  0 ³
³ -Tx -Ty 1 ³ ³  0   0   1 ³ ³ Tx Ty 1 ³
À           Ù À            Ù À         Ù

The matrix of the concatenated transformation is:

   Ú                           ¿
   ³     Sx          0       0 ³
   ³     1           Sy      0 ³
   ³ (-TxSx+Tx)  (-TySy+Ty)  1 ³
   À                           Ù


[Back] [Next]