Game Development Reference
In-Depth Information
in this section. Again, we are not considering translation in this chapter, so
we will limit the discussion to rotation about an axis that passes through
the origin. In any case, we'll need to establish which direction of rotation
is considered “positive” and which is considered “negative.” We're going
to obey the left-hand rule for this. Review Section 1.3.3 if you've forgotten
this rule.
Let's start with rotation about the x-axis, as shown in Figure 5.2. Con-
structing a matrix from the rotated basis vectors, we have
2
4
3
2
3
p
1
0
0
3D matrix to rotate
about the x-axis
5
4
5
R x (θ) =
q
=
0
cosθ sinθ
.
r
0
− sinθ cosθ
Rotation about the y-axis is similar (see Figure 5.3). The matrix to
rotate about the y-axis is
2
4 p
3
2
3
cosθ 0
− sinθ
3D matrix to rotate
about the y-axis
5
4
5
R y (θ) =
q
=
0
1
0
.
r
sinθ 0
cosθ
Figure 5.3
Rotating about the y -axis
in 3D
Search WWH ::




Custom Search