Game Development Reference
In-Depth Information
the previous section. Figure 13.25 shows the effect of the tension parameter.
In each curve, the continuity and bias values are zero. Compare this with
the standard Catmull-Rom curve in Figure 13.24, corresponding to t = 0.
Note that t = 1 results in v i i = v ou i = 0 , causing the velocity to come
to a stop at the knot, creating a cusp in the shape. If we increase t further,
the velocities point in the “wrong direction,” which creates a loop at the
knots. At the other extreme, the value t = −1 results in a curve that is
“twice as loose” as a Catmull-Rom curve. There's nothing special about
this particular value; you can easily make the curve even looser by making
t more negative.
We incorporate tension into the Catmul-Rom tangent formula as follows:
= (1 − t)( k i+1
k i−1 )
v i i = v out
Catmull-Rom formula
extended to allow
tension adjustments
i
2
= (1 − t)
2
k i−1 ) + (1 − t)
2
( k i
( k i+1
k i ).
Next let's turn to the continuity setting, which can be used to break
the smoothness of the curve and force a corner at the knot. The value of
zero will result in equal tangent (no matter what values for tension and
bias are used), thus ensuring C 2 parametric continuity, as discussed in
Section 13.8.1. As we decrease the continuity value, each tangent begins
to turn towards its adjacent knot. At c = −1, each tangent will point
directly to the neighboring knot, causing the “spline” to be composed of
linear segments. Figure 13.26 illustrates the effect that different continuity
values have on the spline.
One important observation to note is that setting c = −1 appears to
have an effect on the shape of the curve similar to that of t = 1; both result
in segments that are shaped like straight line segments. However, they are
very different when viewed from an animation perspective. A spline with
100% tension comes to a stop at each key, and reaches a maximum value
in the middle of the segment. (This is the Hermite smoothstep velocity
profile, observable in the nonuniform spacing of the dots in each segment.)
Notice that Bezier control points for the t = 1 spline in Figure 13.25 are not
visible as they are coincident with the knots. Compare this to the c = −1
spline in Figure 13.26, where the Bezier control points are spaced equally
along each linear segment. We observed earlier that this produces a curve
with constant velocity, as evidenced by the equal spacing of the smaller
black dots used to draw the curve.
Search WWH ::




Custom Search