Game Development Reference
In-Depth Information
The other thing we'd like to discuss is an alternative way to derive
Equation (13.39). Just a bit of algebraic manipulation yields
= k i+1 k i−1
2
Catmull-Rom spline as
average of adjacent delta
vectors
v i i = v out
i
= k i+1
k i + k i
k i−1
2
= ( k i+1
k i ) + ( k i
k i−1 )
.
2
The geometric interpretation of the last line states that to compute a tan-
gent at a knot, we take the two neighboring difference vectors of the control
polygon and average them.
13.9.2 TCB Splines
Section 13.9.1 showed that the tangent at a knot can be computed by
multiplying the vectors of the adjacent edges of the control polygon by an
appropriate constant, which we called a, and adding the result. By varying
a, we had an intuitive “dial” we could turn to adjust the shape of the curve.
We can generalize this idea further by having not just one scaling factor,
but two. In other words, we can take an arbitrary linear combination of the
adjacent edge vectors. Taking the straightforward approach of assigning one
“dial” for each of the two scale factors doesn't quite work out as an intuitive
system. Instead, a standard technique is to provide three intuitive dials,
known as tension, continuity, and bias, and derive the two scale factors
from these dials. A spline with the tangents thus derived is known as
Kochanek-Bartels spline, often called a TCB spline for obvious reasons. 20
Kochanek and Bartels [40] designed the equations so that if we turn all
three dials to zero, we get the standard Catmull-Rom curve. The typical
useful range for all of the parameters is [−1,+1], although there's no prob-
lem in going outside this range. Thus, you can think of each setting as a
way to start with a Catmull-Rom curve and tweak it in a particular direc-
tion. First, let's show how each of these settings could be implemented by
itself, and then let's present the full formulas that combine all three settings
together.
The tension setting is related to the a value we discovered in the previous
section. We the symbol t to refer to tension, and luckily there won't be
any situations where this will be confused with the other meaning of t, the
time parameter. Like all the TCB settings, a value of t = 0 corresponds
to the regular Catmull-Rom curve. As we increase the tension, the curve
“tightens”—essentially the same effect we got by decreasing the value of a in
20 The most important for us is that TCB is easier to pronounce than koh-CHAN-ick.
 
Search WWH ::




Custom Search