[Hill: Chapter 11 (but read these notes first!). Foley & van Dam: p. 478516]
Curves and surfaces can have explicit, implicit, and parametric representations. Parametric representations are the most common in computer graphics.
Parameterizations are in general not unique. Consider the following parameterizations for a line:
L(P_{0},P_{1}) = P_{0} + u(P_{1}P_{0}), u = [0...1] L(P_{0},P_{1}) = v(P_{1}P_{0})/2 + (P_{1}+P_{0})/2, v = [1...1]
Parameterizations can be changed to lie between desired bounds. To reparameterize from u = [a...b] to w = [0...1], we can use w = (ua)/(ba), which gives u = w(ba) + a. Thus, we have:
P(u), u = [a...b] = P(w(ba)+a), w = [0...1]
Cubic curves are commonly used in graphics because curves of lower order commonly have too little flexibility, while curves of higher order are usually considered unnecessarily complex and make it easy to introduce undesired wiggles.
A parametric cubic curve in 3D is defined by:
Usually, we consider t = [0...1].
A compact version of the parametric equations can be written as follows:
Similarly, we can write
y(t) = T B z(t) = T C
Each dimension is treated independently, so we can deal with curves in any number of dimensions.
The derivatives of the curve with respect to t can be expressed as follows:
x'(t) = [3t^{2} 2t 1 0] A
It is often convenient to think of the parameter t as being time in order to visualize some of the properties of the curve. The derivatives also have an intuitive interpretation in the cartesian space of the curve:
Suppose we wish to define a cubic curve such that the user specifies the position of two endpoints and a midpoint, as well as the tangent at the midpoint. The following figure illustrates some sample curves.
We'll first construct the cubic curve for x(t). There are four constraints that are to be met and four unknowns:
We can solve for A using A = B^{1}x. The final equation for x is thus:
x(t) = T B^{1} G_{x}
The matrix B^{1} is often called the basis matrix, which we shall denote by M. We can thus write
x(t) = T M G_{x}
In this case, we have
[ 4 0 4 4 ] M = [ 8 4 6 4 ] [ 5 4 2 1 ] [ 1 0 0 0 ]Lastly, we can also write
x(t) = [ f_{1}(t) f_{2}(t) f_{3}(t) f_{4}(t) ] G_{x}where f_{1}(t) ... f_{4}(t) are the functions obtained from the product T * M. These are functions are called the blending or basis functions, because they serve to give a weighting to the various components of the geometry vector, G. In this case, these are
f_{1}(t) = 4t^{3} + 8t^{2}  5t + 1 f_{2}(t) = 4t^{2} + 4t f_{3}(t) = 4t^{3} + 6t^{2}  2t f_{4}(t) = 4t^{3}  4t^{2} + 1,
where f_{1}(t) is the weighting function for P_{0},
f_{2}(t) is the weighting function for P_{0.5},
f_{3}(t) is the weighting function for T_{0.5}, and f_{4}(t) is the
weighting function for P_{1}. These basis functions look as follows:
The curves for y(t) and z(t) are contructed in an analogous fashion to
that for x(t). The basis matrix and basis functions thus remain the
same. Only the geometry vector changes. The geometry vector for y(t)
gives the y components of P_{0}, P_{0.5}, T_{0.5}, and P_{1}. In
general, we can write the curve as a single vector equation
P(t) = T M G
which encompasses the following three equations:
x(t) = T M G_{x} y(t) = T M G_{y} z(t) = T M G_{z}
As a second example, let's look at Hermite curves. Hermite curves are defined by two points and two tangent vectors.
Let's derive the equation for Hermite curves using the following geometry vector:
G_{h} = [ P_{1} P_{4} R_{1} R_{4} ]^{T}
As before, we'll express the curve as:
x(t) = T A_{h} = T M_{h} G_{h}
The constraints we'll use to define the curve are:
x(0) = P_{1} = [ 0 0 0 1 ] A_{h} x(1) = P_{4} = [ 1 1 1 1 ] A_{h} x'(0) = R_{1} = [ 0 0 1 0 ] A_{h} x'(1) = R_{4} = [ 3 2 1 0 ] A_{h}
Writing these constraints in matrix form gives:
G_{h} = B_{h} A_{h} A_{h} = (B_{h})^{1} G_{h} x(t) = T A_{h} = T (B_{h})^{1} G_{h} = T M_{h} G_{h}
The inverse of B_{h} is thus defined as the basis matrix for the hermite curve.
[ 2 2 1 1 ] M_{h} = [ 3 3 2 1 ] [ 0 0 1 0 ] [ 1 0 0 0 ]
As before, the basis functions are the weighting factors for the terms in the geometry vector, and are given by the product T M_{h}. Thus, for basis functions for Hermite curves are
f_{1}(t) = 2t^{3}  3t^{2} + 1 f_{2}(t) = 2t^{3} + 3t^{2} f_{3}(t) = t^{3}  2t^{2} + t f_{4}(t) = t^{3}  t^{2}
These basis functions look as follows:
Bezier curves are a variation of the Hermite curves. They are specified by four points:
The curve is closely related to the Hermite curve:
P_{1h} = P_{1} P_{4h} = P_{4} R_{1h} = 3 (P_{2}  P_{1}) R_{4h} = 3 (P_{4}  P_{3})
We'll arrive at the basis matrix by expressing the above in matrix form:
[ P_{1h} ] [ 1 0 0 0 ] [ P_{1} ] [ P_{4h} ] = [ 0 0 0 1 ] [ P_{2} ] [ R_{1h} ] [ 3 3 0 0 ] [ P_{3} ] [ R_{4h} ] [ 0 0 3 3 ] [ P_{4} ] P_{h} = M_{bh} P_{b}
The equation for a bezier curve can thus be written as:
P(t) = T M_{h} M_{bh} P_{b} P(t) = T M_{b} P_{b}
where
[ 1 3 3 1 ] M_{b} = [ 3 6 3 0 ] [ 3 3 0 0 ] [ 1 0 0 0 ]
The Bezier basis functions are as follows:
P(t) = T M_{b} G_{b} = f_{1}(t) P_{1} + f_{2}(t) P_{2} + f_{3}(t) P_{3} + f_{4}(t) P_{4} where f_{1}(t) = t^{3} + 3t^{2}  3t + 1 f_{2}(t) = 3t^{3}  6t^{2} + 3t f_{3}(t) = 3t^{3} + 3t^{2} f_{4}(t) = t^{3} or alternatively, f_{1}(t) = (1t)^{3} f_{2}(t) = 3t (1t)^{2} f_{3}(t) = 3t^{2} (1t) f_{4}(t) = t^{3}
The convex hull property ensures that the curve will never pass outside of the convex hull formed by the four control vertices. As such, it lends a measure of predictability to the curve. The Bezier basis functions satisfy the conditions necessary for the convex hull property, namely:
It is not per chance that the basis functions for Bezier curves have the convex hull property. How might one then go about designing a set of basis functions that sum to one and ensure that each individual basis function remain in the range [0,1]? The Bernstein polynomials have exactly the required properties.
Using the Bernsteinn polynomials, we can construct a Bezier curve of arbitrary degree. For curves of higher degree than the cubic Bezier curve discussed thus far, we'll need more than four control points. The general Bezier curve of degree n is given by
The basis functions are equivalent to the terms arising from the expansion of
using the binomial expansion theorem. It is also obvious from this why the sum of all the terms is equal to one.
Hermite curve segments can be connected in a continuous fashion by ensuring that the endpoint of one curve is the same as the starting point of another, as well as ensuring that the tangent vectors for this point have the same direction.
In terms of the above figure, this means P_{1}'=P_{4} and R_{1}'=k R_{4} . For a Bezier curve, the conditions are that the the last two points of one curve and the first two points of the second curve are aligned.
Geometric Continuity
Parametric Continuity
As their names imply, geometric continuity requires the geometry to be continuous, while parametric continuity requires that the underlying parameterization be continuous as well.
Parametric continuity of order n implies geometric continuity of order n, but not viceversa.
The following is an example of a fivesegment Bspline curve (although this is simply a handdrawn example). The points which indicate the ends of the individual curve segments and thus the join points are known as the knots.
Each curve segment is determined by four control points, as follows:
Bspline curves are defined by a basis matrix, just like the other types of cubic curves. We shall not discuss the derivation of this matrix here.
[ 1 3 3 1 ] M_{bspline} = 1/6 [ 3 6 3 0 ] [ 3 0 3 0 ] [ 1 4 1 0 ]
where the geometry vector consists of four consecutive control points. It is easy to show that Bspline curves are C2 continuous and that they satisfy the convexhull property. The basis functions for Bsplines are as follows:
The general form of a multisegment Bspline can be written as follows:
Control vertices can be repeated in order to allow for reduced geometric continuity at the join points.
multiplicity 

1 
G_{2} continuous 
2 
G_{1} continuous 
3 
G_{0} continuous, interpolates point 
One of the disadvantages of the curves discussed to date is that they cannot be used to create common conic shapes such as circles, ellipses, parabolas, etc. This can be done using rational cubic curves, however. A rational cubic curve segment in 3D can be constructed as follows
x(t) = X(t)/W(t) y(t) = Y(t)/W(t) z(t) = Z(t)/W(t)
where each of X(t), Y(t), Z(t), and W(t) are cubic polynomial curves. Defining curves as rational polynomials in this manner allows for simple exact represenations of conic sections such as circles, as well as curves which are invariant under perspective projection.