Game Development Reference
In-Depth Information
= b i + t(3 b i+1 − 3 b i ) + t 2 (3 b i − 6 b i+1 + 3 b i+2 )
+ t 3 (− b i + 3 b i+1
− 3 b i+2 + b i+3 ).
Writing the last line again, but this time assuming the cubic level is the
final level of recursion, we have
p (t) = b 0 (t) = b 0 + t(3 b 1 − 3 b 0 ) + t 2 (3 b 0 − 6 b 1 + 3 b 2 )
+ t 3 (− b 0 + 3 b 1 − 3 b 2 + b 3 ).
Cubic Bezier curve in
monomial form
(13.19)
Just to make sure you didn't miss it, Equation (13.19) tells us how to
convert a cubic Bezier curve to monomial form. Since this is important,
let's write it a bit more deliberately as
c 0 = b 0 ,
c 1 = −3 b 0 + 3 b 1 ,
c 2 = 3 b 0 − 6 b 1 + 3 b 2 ,
c 3 = − b 0 + 3 b 1 − 3 b 2 + b 3 .
Cubic monomial
coe cients from Bezier
control points
We can now put this conversion into a matrix like we did with the quadratic
case in Equation (13.18). The cubic equation for a specific point on the
curve p (t) is written in matrix notation as
2
4 1
3
5
2
4 1
3
5
2
4 | | | |
3
−3
3
−1
Cubic Bezier curve using
matrix notation
0
3
−6
3
t
t 2
t 3
5
p (t) = Ct = BMt =
b 0 b 1 b 2 b 3
|
.
0
0
3
−3
|
|
|
0
0
0
1
We can also invert this process, meaning we can convert any polynomial
curve from monomial form to Bezier form. Given any polynomial curve,
the Bezier control points that describe the curve are uniquely determined:
b 0 = c 0 ,
(13.20)
Computing Bezier
control points from
monomial coe cients
b 1 = c 0 + (1/3) c 1 ,
(13.21)
b 2 = c 0 + (2/3) c 1 + (1/3) c 2 ,
(13.22)
b 3 = c 0 + c 1 + c 2 + c 3 .
(13.23)
And, of course, we can write this in matrix form:
2
4 1
3
2
4 | | | |
3
2
4 | | | |
3
1
1
1
Converting from
monomial to Bezier
form, in matrix notation
5
0
1/3
2/3
1
5
5
b 0 b 1 b 2 b 3
|
=
c 0 c 1 c 2 c 3
|
.
0
0
1/3
1
|
|
|
|
|
|
0
0
0
1
Search WWH ::




Custom Search