Professional Documents
Culture Documents
February 6, 2006
1 Introduction
e1 → a1 e2 → a2 e3 → a3 .
One measure of the behavior of a linear map is the determinant of the matrix
A, or |A|. In 3D the determinant measures the volume of the parallelepiped
formed by the ai vectors (positioned at the origin). Recall that you use
co-factor expansion to compute the determinant of a 3 × 3 matrix.
One other notable difference between 2D and 3D transformations: rotations
are not commutative in 3D. More on rotations below.
1
2 3D Linear Maps
2.1 Scaling
s11 0 0
A = 0 s22 0 |A| = s11 s22 s33
0 0 s33
2.2 Reflection
±1 0 0
A = 0 ±1 0 such that |A| = −1
0 0 ±1
2.3 Shear
Therefore,
1 0 a
A = 0 1 b .
0 0 1
v1 + av3
An arbitrary vector v → v2 + bv3 .
v3
2
Shear parallel to the e1 , e3 -axes:
1 ? 0
A = 0 1 0 .
0 ? 1
Here is a special shear that you have encountered before, most likely un-
knowingly:
1
e1 → −b/a e2 → e2 e3 → e3 ,
−c/a
resulting in the following mapping
1 0 0 a a
−b/a 1 0 b = 0 .
−c/a 0 1 c 0
2.4 Projection
3
2.5 Rotation
The rotation matrices will be set up so that the right-hand rule is preserved:
Align your right thumb with the positive axis about which you will rotate.
Your fingers will curl from one axis to another: A positive angle of rotation
will rotate in this direction. Rotation about e3 :
cos(α) − sin(α) 0
A = sin(α) cos(α) 0 ,
0 0 1
rotates from e3 to e1 .
Rotation about e1 :
1 0 0
A = 0 cos(α) − sin(α) ,
0 sin(α) cos(α)
rotates from e2 to e3 .
The column vectors of a rotation matrix are orthogonal and unit length,
and thus orthonormal. A matrix with orthonormal column vectors is called
orthogonal. These matrices have special a property that is quite handy for
computer graphics:
R−1 (α) = R(−α) = RT (α),
so to reverse a rotation is as simple as applying the transpose of the rotation!
In 3D, matrix products do not commute, and this includes rotations. (Recall
that rotations commute in 2D.) Sketch the following example. Let
4
Try applying these rotations to the vector e1 . You’ll see that
2.6 Properties
w = αu + βv
v̂ = Av û = Au ŵ = Aw
ŵ = αû + β v̂
3 3D Affine Maps
x̂ = A(x − o) + p = Ax + p.
5
4 Homogeneous Coordinates
x1 x4
x1 x2 x4
The homogeneous form of a 3D point x = x2 is x̄ =
x3 x4 . Most of the
x3
x4
time, when you have a 3D point that youwant to represent in homogeneous
x1
x2
coordinates, you will write it as x̄ =
x3 , that is, x4 = 1.
1
Homogenous coordinates represent 4D points. The fourth coordinate is
called the w-coordinate. When we form a 3D point from a homogeneous
point, we divide each coordinate by the w-coordinate,
x1 x4 /x4 x1
x2 x4 /x4 x2
x ≈ x̄ =
x3 x4 /x4 = x3 .
x4 /x4 1
We use the ≈ sign and say that “x corresponds to x̄.” Commonly we think
of the 3D point corresponding to the 4D point with w = 1. Although, all
points on a line through the origin are considered to be equivalent. In other
words, there are many homogeneous representations of the same (affine) 3D
point. This idea is more easily understood (and sketched) by considering
the homogeneous form of a 2D point, which is a 3D point. All points with
z = 1 are affine points.
Homogeneous coordinates serve two purposes in computer graphics:
6
or in short-hand notation:
· ¸
A p
.
0 0 0 1
Later, the zeros in the bottom row will be replaced with a perspective map
definition.
Previously we defined an affine map as
x0 = Ax + p.