Game Development Reference
In-Depth Information
12.2.1.2 Part 2: Rotation
Aligning all three of the camera vectors with the world's axes requires
a little more work. We need a 3 3 rotation matrix A that aligns the
right, up, and look vectors with the world's x-, y-, and z-axis, respec-
tively. Such a matrix would satisfy the following three systems of
equations:
aaa
aaa
aaa
00
01
02
,
,
rA
r
r
r
1
,0,0
x
y
z
10
11
12
20
21
22
aaa
aaa
aaa
00
01
02
,
,
uA
uuu
0
,1,0
x
y
z
10
11
12
20
21
22
aaa
aaa
aaa
00
01
02
dA
ddd
,
,
0
,0,1
x
y
z
10
11
12
20
21
22
Note:
3 matrices here because we do not need
homogeneous coordinates to represent rotations. Later we augment
back to our usual 4
We work with 3
4 matrix.
Since these three systems have the same coefficient matrix A ,wecan
solve them all at once. We rewrite them together as:
r r r
uuu
ddd
aaa
aaa
a
100
010
001
x
y
z
00
01
02
BA
x
y
z
10
11
12
aa
x
y
z
20
21
22
We can solve for A in a variety of ways, but we immediately see that A
is the inverse of B because BA=BB -1 = I . Because B is an orthogo-
nal matrix (its row vectors are an orthonormal basis), we know that its
inverse is its transpose. Thus, the transformation that aligns the orien-
tation vectors with the world's axes is:
r ud
r ud
r ud
x
x
x
1
T
BBA
y
y
y
z
z
z
Search WWH ::




Custom Search