Graphics Reference
In-Depth Information
Buss [BF01] discusses thoroughly the challenges of working with such “affine
combinations” of quaternions.
11.2.7 Stability of Computations
You probably recall solving problems in calculus where you know a position x ( t )
at time t = 0, and you're given a formula for velocity x ( t ) for all t , and you need
to find x at times other than t = 0. The simple method is to say that at t = 0.1,
your position is approximately
x ( 0 )+ 0.1 x ( 0 )
x ( 0.1 )
(11.42)
x ( 0.1 )+ 0.1 x ( 0.1 ) , etc. This is called Euler integra-
tion of the position with a time step of 0.1, and it gives a crude approximation of
the solution to the problem. Picking a time step smaller than 0.1 produces better
results, but at a cost of greater computational effort. Chapter 35 discusses this, and
better approximations, extensively.
The analogy for the attitude (i.e., the rotation matrix currently applied to some
model) is that you're given the attitude at time t = 0, and the change in attitude
for all t , and you have to “integrate” to find the attitude at all times. The “update”
step is
and then compute x ( 0.2 )
M ( 0.1 )= M ( 0 )( I + 0.1 M ( 0 ))
(11.43)
so that it's multiplicative rather than additive. One problem is that I + 0.1 M ( 0 ) is
not actually a rotation matrix. It's very close, but not quite. So, after the update, we
have to convert M into a rotation matrix, typically by applying the Gram-Schmidt
process to the columns of M (i.e., normalize the first column; make the second
perpendicular to it; normalize the second; make the third perpendicular to both;
normalize the third column). This is computationally fairly expensive.
As an alternative, we can store the current attitude as a unit quaternion q .The
update, in that case, looks like this:
q ( 0.1 )= q ( 0 )+ 0.1 q ( 0 ) .
(11.44)
Once again, the resultant vector at t = 0.1 is not quite what we want: It may not
be a unit vector, so we have to normalize it. Notice, however, that normalizing
a vector requires much less work than performing the Gram-Schmidt process on
a whole matrix. And while a matrix can fail to be a rotation in many ways (one
or more columns not unit length, various pairs of columns not perpendicular), a
quaternion can fail to be a unit quaternion in only one way. For this reason, anima-
tion systems often represent attitude with a quaternion, converting it to a rotation
matrix with the map K only when necessary. Computations on a quaternion tend
to be more numerically stable than those on a rotation matrix as well.
11.3 Comparing Representations
We've now seen four ways to represent a 3D rigid reference frame (i.e., a set of
three orthogonal unit vectors forming a right-handed coordinate system, based at
some location P ).
 
 
 
Search WWH ::




Custom Search