Game Development Reference
In-Depth Information
What about C 1 continuity? Remember that the velocity at an endpoint
is completely determined by the endpoint and the adjacent control point.
This means if we want to match the velocity, we are locking in the position
of the second control point as well.
Continuing this pattern, we see that for a Bezier segment to match n
derivatives requires us to “lock in” n + 1 control points. For a cubic curve,
if we ask for C 4 continuity or higher, we can get it, but only by making
every segment be a piece of the same infinite polynomial. We have gained
continuity, but we have lost the flexibility that was the very reason we used
splines in the first place!
The bottom line is that, practically speaking, a polynomial curve of
degree n (a Bezier curve with n + 1 control points) can really achieve only
C n−1 continuity. For example, a piecewise linear (degree 1) polynomial can
only achieve C 0 continuity. We can make a curve which is connected, but
with straight lines, we cannot match the tangents. A quadratic (degree 2)
polynomial can match tangents (C 1 ), but not accelerations. A cubic curve,
the type of curve we have been focusing on in this topic, can achieve C 2
continuity by reducing the number of degrees of freedom per segment to
one. Continuity beyond C 2 can be achieved only by eliminating all degrees
of freedom (other than the curve timing), and setting each segment to be
a section of the same polynomial.
13.9
Automatic Tangent Control
At the start of this chapter, we began our investigation into curves with
the plan of defining a curve just by listing points that we wanted the curve
to pass through. We tried basic polynomial interpolation in Section 13.2,
but found that it didn't give us what we wanted. We then developed
the Bezier forms, which require the user to specify two endpoints, which
are interpolated, and two (in the case of a cubic Bezier) interior control
points, which are not interpolated but instead define the derivatives at the
endpoints. So far in this chapter, we've learned how to piece together those
Bezier segments in a smooth spline.
This section investigates various methods whereby a spline can be de-
termined by just the knots, without the need for the user to specify any
additional criteria. This is useful to generate a curve that looks “natural”
and passes through some points, or any other time we wish to smoothly
interpolate some data points.
For the moment, let's ignore the first and last knots and focus our
attention on the interior knots. The problem at hand is to compute an
appropriate v i i and v ou i using only the positions of the knots. Notice that
we are posing the problem in Hermite form, which turns out to be the easiest
form to use for this problem. The situation is depicted in Figure 13.23,
 
Search WWH ::




Custom Search