Graphics Reference
In-Depth Information
1
2
Interpolation steps
1. 1/3 of the way between pairs
of points
2. 1/3 of the way between points
of step 1
3. 1/3 of the way between points
of step 2
2
1
3
1
FIGURE 3.29
de Casteljau construction of point on cubic Bezier segment at 1/3 (the point labeled “3”).
Once the internal control points are computed, the de Casteljau algorithm can be applied to inter-
polate points along the curve. An example of the de Casteljau construction procedure in the two-
dimensional Euclidean case of Bezier curve interpolation is shown in Figure 3.29 . See Appendix
B.5.10 for a more complete discussion of the procedure.
The same procedure can be used to construct the Bezier curve in four-dimensional spherical
space. For example, to obtain an orientation corresponding to the u ¼
1/3 position along the curve,
the following orientations are computed:
p1 ¼ slerp (q n ,a n ,1/3)
p2 ¼ slerp (a n ,b n þ 1 ,1/3)
p3 ¼ slerp (b n11 ,q n11 ,1/3)
p12 ¼ slerp (p 1 ,p 2 ,1/3)
p23 ¼ slerp (p 2 ,p 3 ,1/3)
p
¼ slerp (p12,p23,1/3)
where p is the quaternion representing an orientation 1/3 along the spherical cubic spline.
The procedure can be made especially efficient in the case of quaternion representations when cal-
culating points at positions along the curve corresponding to u values that are powers of 1/2. For exam-
ple, consider calculating a point at u ¼
1/4.
temp ¼ slerp (q n ,a n ,1/2) ¼ (q n þ a n )/||q n þ a n ||
p 1 ¼ slerp (q n ,temp,1/2) ¼ (q n þ temp)/||q n þ temp||
temp ¼ slerp (a n ,b n11 ,1/2) ¼ (a n þ b n11 )/|| a n þ b n11 ||
p 2 ¼ slerp (a n ,temp,1/2) ¼ (a n þ temp)/|| a n þ temp||
temp ¼ slerp (b n11 ,q n11 ,1/2) ¼ (b n þ 1 þ q n11 )/|| b n þ 1 þ q n11 ||
p 3 ¼ slerp (b n11 ,temp,1/2) ¼ (b n þ 1 þ temp)/|| b n þ 1 þ temp ||
temp ¼ slerp (p 1 ,p 2 ,1/2) ¼ (p 1 þ p 2 )/|| p 1 þ p 2 ||
p 12 ¼ slerp (p 1 ,temp,1/2) ¼ (p 1 þ temp)/|| p 1 þ temp ||
temp ¼ slerp (p 2 ,p 3 ,1/2) ¼ (p 2 þ p 3 )/|| p 2 þ p 3 ||
p 23 ¼ slerp (p 2 ,temp,1/2) ¼ (p 2 þ temp)/|| p 2 þ temp ||
temp ¼ slerp (p 12 ,p 23 ,1/2) ¼ (p 12 þ p 23 )/|| p 12 þ p 23 ||
p ¼ slerp (p 12 ,temp,1/2) ¼ (p 12 þ temp)/|| p 12 þ temp ||
 
Search WWH ::




Custom Search