Graphics Reference
In-Depth Information
continuity at the junction of adjacent curve segments (in this case, p n ) because the control points on
either side of the point are colinear with, and equidistant to, the control point itself.
The end conditions can be handled by a similar construction. For example, the first control point, a 0 ,
is constructed as the vector from the third interpolated point to the second point ( p 1 p 2 ) is added to the
second point ( Figure 3.27 ) .
In forming a control point, the quality of the interpolated curve can be affected by adjusting the
distance the control point is from its associated interpolated point while maintaining its direction from
that interpolated point. For example, a new b n 0 can be computed with a user-specified constant, k, as in
Equation 3.30 (and optionally computing a corresponding new a n 0 ).
0
n ¼ p n þ kðb n p n Þ
b
(3.30)
Between any two interpolated points, a cubic Bezier curve segment is then defined by the points p n ,
a n , b n þ 1 , and p n þ 1 . The control point b n þ 1 is defined in exactly the same way that b n is defined except
for using p n , p n þ 1 , and p n þ 2 . The cubic curve segment is then generated between p n and p n þ 1 (see
Figure 3.28 ) .
It should be easy to see how this procedure can be converted into the four-dimensional spherical
world of quaternions. Instead of adding vectors, rotations are concatenated using quaternion multi-
plication. Averaging of orientations can easily be done by slerping to the halfway orientation, which
is implemented by adding quaternions (and optionally normalizing). Adding the difference between
two orientations, represented as unit quaternions p and q , to the second orientation, q , can be affected
by constructing the representation of the result, r , on the four-dimensional unit sphere using
Equation 3.31 . See Appendix B.3.4 for further discussion.
¼
ð
:
Þ
r
2
p
q
q
p
(3.31)
a 0
a 0
p 1
p 2
p 0
FIGURE 3.27
Constructing the first interior control point.
p n
p n 1
a n
p n 2
b n 1
a n 1
p n 1
1
FIGURE 3.28
Construction of b n þ 1 and the resulting curve.
 
Search WWH ::




Custom Search