Graphics Reference
In-Depth Information
not necessarily produce a unit quaternion, so the result must be normalized if a unit quaternion is
desired.
sin
ðð
uÞyÞ
sinðyÞ
1
sin
ðuyÞ
sinðyÞ
slerpðq 1 ; q 2 ; uÞ¼
q 1 þ
q 2
(3.29)
Notice that in the case u ¼
1/2, slerp ( q 1 , q 2 , u ) can be easily computed within a scale factor, as q 1 þ q 2 ,
which can then be normalized to produce a unit quaternion.
When interpolating between a series of orientations, slerping between points on a spherical surface
has the same problem as linear interpolation between points in Euclidean space: that of first-order dis-
continuity (see Appendix B.5 ). Shoemake [ 7 ] suggests using cubic Bezier interpolation to smooth the
interpolation between orientations. Reasonable interior control points are automatically calculated to
define cubic segments between each pair of orientations.
To introduce this technique, assume for now that there is a need to interpolate between a sequence of
two-dimensional points, [
]; thesewill be referred to as the interpolated points . (How
to consider the calculations using quaternion representations is discussed below.) Between each pair of
points, two control points will be constructed. For each of the interpolation points, p n , two control points
will be associated with it: the one immediately before it, b n , and the one immediately after it, a n .
To calculate the control point following any particular point p n , take the vector defined by p n -1 to p n
and add it to the point p n . Now, take this point (marked “1” in Figure 3.25 ) and find the average of it and
p 1 . This becomes one of the control points (marked “ a n ”in Figure 3.25 ) .
Next, take the vector defined by a n to p n and add it to p n to get b n ( Figure 3.26 ) . Points b n and a n are
the control points immediately before and after the point p n . This construction ensures first-order
, p n -1 , p n , p 1 ,
...
...
1
p n
p n 1
a n
p n 2
p n 1
FIGURE 3.25
Finding the control point after
p n :to
p n , add the vector from
p n -1 to
p n and average that with
p n þ1 .
p n
b n
p n 1
a n
p n 2
p n 1
FIGURE 3.26
Finding the control point before p n :top n , add the vector from a n to p n .
 
Search WWH ::




Custom Search