Game Development Reference
In-Depth Information
r 2 = b 2 /2 + b 3 /2,
r 3 = b 3 .
The general case is obtained through blossoming, which is a general
term referring to a number of techniques involving repeated de Casteljau
steps taken with different interpolation fractions. To determine each control
point, we take three de Casteljau steps (for a cubic curve, at least). For
each control point b i we take i of those steps using t = b, and the rest using
t = a. As it turns out, it doesn't matter which of the interpolation steps
use a and which use b, but the number of steps using a or b is important.
Let's consider each point on the cubic curve to make this clear. To compute
b 0 , at each round we use t = a as the interpolation fraction. For b 1 , we
use t = a for two of the rounds, and t = b for one round. To calculate b 2 ,
we use t = a for the interpolation fraction in only one round, and t = b for
the other two. And of course, for the last control point b 3 , we use t = b for
all three rounds, exactly as we described at the start of this section.
13.6
Splines
So far we have been focusing on cubic curves, and for good reason; they
are the most commonly used type of curves in 3D. Such curves inherently
have four degrees of freedom, whether we are using Bezier curves with four
control points, monomial curves with four coe cients, or Hermite curves
with two ending points plus two derivatives. Because there are only four
degrees of freedom, the set of curves that can be represented by using only
the techniques of cubic curves is sharply limited.
Additional freedom is obtained by joining smaller curves together in
a spline, which is the subject of the remainder of this chapter. Before we
discuss splines, let's pause for a moment to discuss one potential alternative:
using a higher degree polynomial. Obviously any degree n curve can be
converted to a degree n + 1 curve; such a conversion is known as degree
elevation. In monomial form, of course, this is trivial, we just add a new
leading coe cient of zero.
In Bezier form, degree elevation adds a new control point and, as you
might have guessed, the positions of the new control points can be con-
structed geometrically by using linear interpolation. Given a curve of degree
n, which has n + 1 control points denoted b i , degree elevation produces a
degree n+1 curve with n+2 control points, denoted b
j . To determine these
new control points, we linearly interpolate using an interpolation fraction
proportional to the index of the control point:
j
n + 1 b j−1 +
1 − j
n + 1
j =
Degree elevation in
Bezier form
b
b j ,
0 ≤ j ≤ n + 1.
(13.38)
 
Search WWH ::




Custom Search