Game Development Reference
In-Depth Information
by P, but instead of starting at 0 and ending at 1, start at a and end at b.”
That's not really what we want. We want Q to be a fully independent and
“regular” curve that makes no reference to P, not subordinate or qualified
in some way. For example, if we are using Bezier form, then we want new
Bezier control points that define Q.
The following sections present two different methods for subdividing
curves. Section 13.5.1 presents a straightforward algebraic approach in
monomial form. Section 13.5.2 considers Bezier curve subdivision, which
is geometrically based and lends itself towards rather elegant and e cient
implementations.
Hermite form doesn't lend itself naturally to subdivision. If we wish
to subdivide a Hermite form, we first convert the curve to another form
(probably Bezier) and do the subdivision in that form.
13.5.1 Subdividing Curves in Monomial Form
Extracting a segment from a curve in monomial form is a straightforward
algebraic task. Remember that monomial form is just an explicit poly-
nomial on t. Although we are typically interested only in the part where
0 ≤ t ≤ 1, the polynomial is defined for all values of t and so it actually
defines an infinite curve. The smaller segment Q that we wish to extract
is just a different subsection of the same infinite curve.
With this in mind, we realize that the problem of subdivision can easily
be viewed as a simple problem of reparameterization. Rather than trying
to muck directly with the monomial coe cients, we perform some algebra
on the parameter value. Let's introduce a local parameter s that varies
from 0 to 1 as q (s) traces out the curve Q. Given this, we can define the
curve q (s) in terms of p (t) as
t = F(s),
q (s) = p (t) = p (F(s)),
where the function F(s) is our reparameterization function that returns
the global parameter t corresponding to the local parameter s. It's not too
hard to see what form F should be, since we wish to satisfy the endpoint
conditions F(0) = a and F(1) = b. Adopting a straightforward linear
relation between t and s yields
t = F(s) = a + s(b − a).
You might want to verify that this does behave correctly at the endpoints.
Of course, all we have really accomplished is to define Q in terms of
P, which is precisely what we said was not su cient at the start of this
section. The difference is that if we continue working through the math, and
substitute for p (t) and eliminate t, we can get a direct equation for q (s),
 
Search WWH ::




Custom Search