Game Development Reference
In-Depth Information
6. It's obvious that b 0 is the starting point of the line, and b 3 is the ending point, but what
to do with the interior points b 1 and b 2 is not quite as obvious. One way to solve it is to
write out the equation of the ray in monomial form.
p(t) = p 0 + (p 1 −p 0 )t
Now, if we extract the monomial coe cients
c 0 = p 0 ,
c 1 = p 1 −p 0 ,
c 2 = 0,
c 3 = 0,
we can use Equations (13.20)-(13.23) to convert to Bezier form:
b 0 = c 0 = p 0
b 1 = c 0 + (1/3)c 1 = p 0 + (1/3)(p 1 −p 0 )
b 2 = c 0 + (2/3)c 1 + (1/3)c 2 = p 0 + (2/3)(p 1 −p 0 )
b 3 = c 0 + c 1 + c 2 + c 3 = p 0 + (p 1 −p 0 ) = p 1
Note that b 0 and b 3 are mapped to the endpoints, as expected. To achieve a constant
velocity, we divide the ray into thirds and place the two intermediate points at the division
between these thirds.
This makes sense when you think about what a constant velocity curve looks like in Hermite
form. The difference vector p 1 − p 0 must be traversed over the unit time interval, so the
desired velocity vectors v 0 and v 1 are both equal to this difference vector. Recalling the
relationship between the Bezier control points and the Hermite vectors (Equations (13.32)-
(13.35)) leads us to the same conclusion obtained above.
It also makes sense when you think about the Bernstein basis. Remember that each basis
function B i (t) has one local maximum at t = i/n where the corresponding control point
b i exerts the most influence over the curve.
7. We hope you were able to get this one just by thinking about it. We know that the starting
and ending velocities of the curve are zero, and so in Hermite form the vectors v 0 and v 1
are zero. Since the interior Bezier control points are offset from the endpoints by one-third
of the velocity, that means the second control point must be the same as the first, and the
third control point should be the same as the last:
b 1 = b 0 + (1/3)v 0 = b 0 + (1/3)0 = b 0 ,
b 2 = b 3 −(1/3)v 1 = b 3 −(1/3)0 = b 3 .
8. To solve this one, let's convert to Hermite form and examine the starting and ending
velocities:
v 0 = 3(b 1 −b 0 ) = 3(b 3 −b 0 ),
v 1 = 3(b 3 −b 2 ) = 3(b 3 −b 0 ).
We know from Exercise 6 that if the interior points are distributed equally, dividing the
interval into thirds, then the resulting curve has a constant velocity. But now, the interior
Search WWH ::




Custom Search