i
i
i
i
i
i
i
i
4.1. Basic Transforms 61
Some computer graphics texts [348, 349] use a slightly different kind of
shear matrix:
H
xy
(s, t)=
⎛
⎜
⎜
⎝
10s 0
01t 0
0010
0001
⎞
⎟
⎟
⎠
. (4.13)
Here, however, both subscripts are used to denote that these coordinates
are to be sheared by the third coordinate. The connection between these
two different kinds of descriptions is H
ij
(s, t)=H
ik
(s)H
jk
(t), where k is
used as an index to the third coordinate. The right matrix to use is a
matter of taste and API support.
Finally, it should be noted that since the determinant of any shear
matrix |H| = 1, this is a volume preserving transformation.
4.1.5 Concatenation of Transforms
Due to the noncommutativity of the multiplication operation on matrices,
the order in which the matrices occur matters. Concatenation of transforms
is therefore said to be order-dependent.
As an example of order dependency, consider two matrices, S and R.
S(2, 0.5, 1) scales the x-component by a factor two and the y-component
by a factor 0.5. R
z
(π/6) rotates π/6 radians counterclockwise around the
z-axis (which points outwards from page of this book). These matrices can
be multiplied in two ways, with the results being totally different. The two
cases are shown in Figure 4.4.
The obvious reason to concatenate a sequence of matrices into a single
one is to gain efficiency. For example, imagine that you have an object that
has several thousand vertices, and that this object must be scaled, rotated,
and finally translated. Now, instead of multiplying all vertices with each
of the three matrices, the three matrices are concatenated into a single
matrix. This single matrix is then applied to the vertices. This composite
matrix is C = TRS. Note the order here: The scaling matrix, S, should
be applied to the vertices first, and therefore appears to the right in the
composition. This ordering implies that TRSp =(T(R(Sp))).
4
It is worth noting that while matrix concatenation is order-dependent,
the matrices can be grouped as desired. For example, say that with TRSp
you would like to compute the rigid-body motion transform TR once. It
4
Another valid notational scheme sometimes seen in computer graphics uses matrices
with translation vectors in the bottom row. In this scheme, the order of matrices would
be reversed, i.e., the order of application would read from left to right. Vectors and
matrices in this notation are said to be in row-major form since the vectors are rows. In
this book, we use column-major form.