Game Development Reference
In-Depth Information
The math behind TCB continuity is written as
= (1 − c)
2
k i−1 ) + (1 + c)
2
Catmull-Rom formula
extended to allow
continuity adjustments
v i i
( k i
( k i+1
k i ),
= (1 + c)
2
k i−1 ) + (1 − c)
2
v out
i
( k i
( k i+1
k i ).
Finally, the bias argument can be used to turn the tangents towards one
or the other adjacent knots, rather than being parallel to the line between
the adjacent knots, as the Catmull-Rom curve does. Consider a sequence
of three knots. A negative bias causes the curve to “anticipate” the third
knot, turning the curve in the direction of the third knot a bit before the
middle knot is reached. In contrast, a positive bias value causes the curve
to wait to make the turn towards the third knot, causing some “overshoot”
through the middle knot. Figure 13.27 shows our example spline with
several different bias values.
The bias value works by scaling the relative weights that the two control
polygon edges have on the resultant tangent:
= (1 + b)
2
( k i k i−1 ) + (1 − b)
2
Catmull-Rom formula
extended to allow bias
adjustments
v i i = v out
( k i+1 k i ).
i
The equations presented thus far have isolated each setting to make it
easier to understand the math behind each one. Now let's put all three
settings together:
Computing Tangents for TCB Splines
= (1−t)(1+b)(1−c)
2
(1−t)(1−b)(1+c)
2
v i i
( k i
k i−1 ) +
( k i+1
k i ),
= (1−t)(1+b)(1+c)
2
(1−t)(1−b)(1−c)
2
v out
i
( k i
k i−1 ) +
( k i+1
k i ).
One last note. The examples in this section used the same values at
each knot in the spline, but that need not be the case. The TCB values are
often adjusted on a per-knot basis.
Search WWH ::




Custom Search