Game Development Reference
In-Depth Information
the x- and y-coordinates are shifted by the other coordinate, z. We present
these matrices for completeness:
2
4
3
5
1 0 0
0 1 0
s t 1
H xy (s,t) =
,
2
3
1 0 0
s 1 t
0
3D shear matrices
4
5
H xz (s,t) =
,
0
1
2
3
1 s t
0
4
5
H yz (s,t) =
1
0
.
0
0
1
Shearing is a seldom-used transform. It is also known as a skew trans-
form. Combining shearing and scaling (uniform or nonuniform) creates a
transformation that is indistinguishable from a transformation containing
rotation and nonuniform scale.
5.6
Combining Transformations
This section shows how to take a sequence of transformation matrices and
combine (or concatenate) them into one single transformation matrix. This
new matrix represents the cumulative result of applying all of the original
transformations in order. It's actually quite easy. The transformation that
results from applying the transformation with matrix A followed by the
transformation with matrix B has matrix AB . That is, matrix multiplica-
tion is how we compose transformations represented as matrices.
One very common example of this is in rendering. Imagine there is an
object at an arbitrary position and orientation in the world. We wish to
render this object given a camera in any position and orientation. To do
this, we must take the vertices of the object (assuming we are rendering
some sort of triangle mesh) and transform them from object space into
world space. This transform is known as the model transform, which we
denote M obj→wld . From there, we transform world-space vertices with the
view transform, denoted M wld→cam , into camera space. The math involved
is summarized by
p wld = p obj M obj→wld ,
p cam = p wld M wld→cam
= ( p obj M obj→wld ) M wld→cam .
 
Search WWH ::




Custom Search