Game Development Reference
In-Depth Information
But how long should the tangents be? Perhaps we should again use
the vector between the previous and next knots as our guide. It seems as
though the farther apart our neighbors are, the larger the curve, and so
making our tangents be a constant multiple of this vector would be a good
idea. In other words, we would set v i i
= v out
i
= a( k i+1
k i−1 ). But what
should we use for the value of a?
One way would be just to experiment and find a nice round number that
seems to give results that are aesthetically pleasing. The constant a = 1/2
is a nice round number and works moderately well, so let's go with that.
Figure 13.24 shows a spline loop generated by this technique.
Figure 13.24
A Catmull-Rom spline
Although a = 1/2 gives “medium” results, there's definitely an argu-
ment to be made that it is a matter of preference. Sometimes we want a
“tighter” curve, which would correspond to smaller values of a, and some-
times we want a “looser” curve. This is a good idea, but let's put it on
ice for a moment to say two more quick things about the method we've
stumbled upon.
First, let's give a formal definition and name to this technique. A spline
with the tangents derived according to the relation
Tangent computation for
the Catmull-Rom spline
and its Bezier control
polygon
= k i+1 k i−1
2
v i i
= v out
i
(13.39)
is known as a Catmull-Rom spline. The name comes from the two people
who invented it, one of whom is Edwin Catmull (1945-). He later went
on to become the president of Walt Disney Animation Studios and Pixar
Animation Studios.
 
Search WWH ::




Custom Search