Game Development Reference
In-Depth Information
Section 11.8.2 showed how to compute the velocity of this vector: v = ω× r .
This can be written equivalently as
r = ω × r .
(12.34)
Section 11.8 stated that is it a basic feature of uniform circular motion
that the velocity varies continuously due to centripetal acceleration. Since
the velocity is not constant, as we've just seen, a simple Euler-step is not
accurate: r (t+h) = r (t)+h r . However, if we zoom in close enough, a small
segment of the circular path starts to look very much like a straight line,
and the Euler step isn't that bad. In other words, with a small enough h, or
a slow enough angular velocity ω, the approximation might be acceptable:
r (t + h) ≈ r (t) + h r .
Everything we've said so far works for any vector r , so let's apply these
ideas to the body axes themselves. Remember that the rotation matrix
R describes the orientation of the object and rotates row vectors on the
left from body space to upright space. The rows of R are formed by the
body axes expressed in upright space. What we want to do is apply Equa-
tion (12.34) to each body axis (i.e., take the cross product of ω with each
row). Luckily, we can write the cross product operation as a matrix multi-
plication (see Exercise 4.8) as
2
3
0
ω z
−ω y
4
5
r = ω × r = r
−ω z
0
ω x
.
ω y
−ω x
0
Now, the derivative of the rotation matrix can be expressed as the matrix
product
2
3
Derivative of orientation
matrix R for an object
with angular velocity ω
0
ω z
−ω y
R = R
4
5
−ω z
0
ω x
.
ω y
−ω x
0
What does this mean? Just as with a single vector r and its derivative r ,
each element in R gives the derivative of the corresponding element in R .
In reality, any particular element of the matrix function R (t) will oscillate
within the range [−1,1]. But as before, for small values of h (and small
angular velocities ω!), a small section of this curved, oscillatory pattern
looks like a straight line, and the simple Euler step R k+1 R k +h R k might
be acceptable. However, with rotation matrices, a new wrinkle is present:
the resulting matrix is unlikely to be orthonormal. In essence, we are taking
Euler steps on each component in isolation, ignoring their interdependence.
The solution is to re-orthogonalize the matrix (see Section 6.3.3) after each
step.
If the orientation of the body is specified by using a quaternion rather
than a rotation matrix, the same basic technique can still be used: find the
Search WWH ::




Custom Search