Graphics Reference
In-Depth Information
The resulting curve is smooth but can sometimes produce unwanted wiggles. Specifying fewer control
points (2
<j ) can remove these wiggles but N is no longer square. To solve the matrix equa-
tion, the use of the pseudoinverse of N is illustrated in Equation 3.27 , but in practice a more numerically
stable and robust algorithm for solving linear least-squares problems should be used (e.g., see [ 1 ]).
k n þ
1
P
¼ NB
N T P
¼ N T NB
(3.27)
½N T N 1
N T P ¼ B
3.3 Interpolation of orientations
The previous section discussed the interpolation of position through space and time. However, when
dealing with objects, animators are concerned not only with the object's position, but also with the
object's orientation. An object's orientation can be interpolated just like its position can be interpolated
and the same issues apply. Instead of interpolating x , y , z positional values, an object's orientation
parameters are interpolated. Just as an object's position is changed over time by applying translation
transformations, an object's orientation is changed over time by applying rotational transformations.
As discussed in the previous chapter, quaternions are a very useful representation for orientation and
they will be the focus here.
3.3.1 Interpolating quaternions
One of the most important reasons for choosing quaternions to represent orientation is that they can be
easily interpolated. Most important, the quaternion representation avoids the condition known as gim-
bal lock , which can trouble the other commonly used representations such as fixed angles and Euler
angles.
Because the magnitude of a quaternion does not affect the orientation it represents, unit quaternions
are typically used as the canonical representation for an orientation. Unit quaternions can be considered
as points on a four-dimensional unit sphere.
Given two orientations represented by unit quaternions, intermediate orientations can be produced
by linearly interpolating the individual quantities of the quaternion four-tuples. These orientations can
be viewed as four-dimensional points on a straight-line path from the first quaternion to the second
quaternion. While equal-interval, linear interpolation between the two quaternions will produce orien-
tations that are reasonably seen as between the two orientations to be interpolated, it will not produce a
constant speed rotation. This is because the unit quaternions to which the intermediate orientations map
will not create equally spaced intervals on the unit sphere. Figure 3.23 shows the analogous effect when
interpolating a straight-line path between points on a two-dimensional circle.
Intermediate orientations representing constant-speed rotation can be calculated by interpolating
directly on the surface of the unit sphere, specifically along the great arc between the two quaternion
points. In the previous chapter, it was pointed out that a quaternion, [ s , v ], and its negation, [
v ],
represent the same orientation. That means that interpolation from one orientation, represented by the
quaternion q 1 , to another orientation, represented by the quaternion q 2 , can also be carried out from q 1
to q 2 . The difference is that one interpolation path will be longer than the other. Usually, the shorter
path is the more desirable because it represents the more direct way to get from one orientation to the
other. The shorter path is the one indicated by the smaller angle between the four-dimensional
s ,
 
Search WWH ::




Custom Search