Game Development Reference
In-Depth Information
Plugging these coe cients into the velocity formula (Equation (13.29)), we
obtain a formula for the instantaneous velocity of a curve in terms of the
Bezier control points:
First derivative
(velocity) of a cubic
Bezier curve
v (t) = c 1 + 2 c 2 t + 3 c 3 t 2
= (3 b 1 − 3 b 0 ) + 2(3 b 0 − 6 b 1 + 3 b 2 )t + 3(− b 0 + 3 b 1 − 3 b 2 + b 3 )t 2 .
Now consider the velocity at the endpoints t = 0 and t = 1:
Velocity at the endpoints
of a cubic Bezier curve
v (0) = (3 b 1
− 6 b 1 + 3 b 2 )(0)
+ 3(− b 0 + 3 b 1 − 3 b 2 + b 3 )(0) 2
= 3( b 1 b 0 ),
− 3 b 0 ) + 2(3 b 0
(13.30)
v (1) = (3 b 1
− 6 b 1 + 3 b 2 )(1)
+ 3(− b 0 + 3 b 1 − 3 b 2 + b 3 )(1) 2
= 3 b 1 − 3 b 0 + 6 b 0 − 12 b 1 + 6 b 2 − 3 b 0 + 9 b 1 − 9 b 2 + 3 b 3
= 3( b 3 b 2 ).
− 3 b 0 ) + 2(3 b 0
(13.31)
This is interesting. Observe that b 1
b 0 gives us the vector from the first
control point to the second control point, and b 3 b 2 is the vector from
the third control point to the last control point. So the tangent at the
start of the curve at t = 0 is “aimed towards” the first control point, and
the tangent at the end of the curve at t = 1 is “aimed towards” the third
control point. (Actually, the tangent at t = 1 points directly away from
the third control point, if we think about moving along the curve in the
direction of increasing t). This is a key point.
The first edge of the Bezier control polygon completely determines the
tangent at the start of the curve, and the last edge determines the tangent
at the end of the curve.
Another way to illustrate the role of the middle control points in a cubic
Bezier curve is to examine the relationship between the Bezier and Hermite
forms. Remember that the cubic Hermite form contains the initial position
p 0 and velocity p 1 and the final position p 1 and velocity v 1 . Now that
we know the relationship between the Bezier control points and the curve
velocity, it's easy to convert from Bezier to Hermite form:
Search WWH ::




Custom Search