Game Development Reference
In-Depth Information
Figure 13.21. A spline with its B ezier control polygon, and the notation we use for B ezier
splines
spline notation:
v i i
v i i /3,
= 3( k i
f i ),
f i = k i
Converting between
Bezier and Hermite
forms
v out
i
a i = k i + v out
= 3( a i
k i ),
/3.
i
13.8
Continuity
For a few sections now we've been promising to tell you how you can piece
together segments into a spline such that they fit together smoothly. All
this lead-up may have given the impression that it's a mysterious secret.
But if you take a closer look at Figure 13.19, you'll see that the criterion is
relatively obvious: if the incoming and outgoing velocity vectors are equal
at a knot, as they are at k 1 and also k 2 , then the curve will be smooth.
Notice that at k 3 , the tangents are not equal, and the curve has a kink in
it. Pretty obvious, eh? Actually, as it turns out, there's quite a bit more
to say on this subject.
Consider the curve near k 4 in Figure 13.19. Notice that the curve is
“smooth,” yet the incoming velocity vector v i 4 is much longer than v ou 4 .
Now, you might be thinking, “That curve isn't smooth there! If you were
traveling along the curve, you would slam on the brakes just as you crossed
the key.” But take the tangent vectors out of the diagram and just look
at the shape of the curve. It's a smooth shape, right? We're back to
a recurring theme: animation paths are more “demanding” than static
shapes. (Notice that in the objection you just raised, you used animation-
oriented terminology when you said “key” instead of “knot.” You're really
catching on fast!)
 
Search WWH ::




Custom Search