Game Development Reference
In-Depth Information
ing at zero (which will appeal to the C programmers amongst us). Also,
as with Aitken's algorithm, we add a superscript to indicate the level of
recursion. The original control points are assigned level 0, thus
b
i
=
b
i
.
With that out of the way, let's consider a specific parameter value t from
0 to 1. The de Casteljau algorithm geometrically constructs the correspond-
ing point on the curve
p
(t) as follows. Between each pair of consecutive
control points, we interpolate according to the fraction t to obtain a new
point. So, starting with the original four control points
b
0
...
b
3
, we derive
three new points
b
0
,
b
1
, and
b
2
. Another round of interpolation between
each pair of these three points gives us two points
b
0
and
b
1
, and a final
interpolation yields the point
b
0
=
p
(t) we're looking for. Figure 13.11
shows the de Casteljau algorithm applied to the same curve at t = .25,
t = .50, and t = .75.
t = .25
t = .50
t = .75
b
1
b
1
b
1
b
2
b
2
b
2
b
0
b
3
b
0
b
3
b
0
b
3
b
1
b
1
b
1
b
0
b
2
b
0
b
2
b
0
b
2
b
0
b
1
b
0
b
1
b
0
b
1
b
0
b
0
b
0
Figure 13.11
The de Casteljau algorithm applied to a cubic curve
Search WWH ::
Custom Search