next up previous
Next: B-splines Up: Some Mathematics for Advanced Previous: Ray tracing primitives

Subsections

Bezier curves

A Bezier curve is a weighted sum of n+1 control points, ${\bf P}_0,{\bf P}_1,\ldots,{\bf P}_n$, where the weights are the Bernstein polynomials:

\begin{displaymath}{\bf P}(t)
=\sum_{i=0}^{n}
\left(\begin{array}{c}n\\ i\end{array}\right)
(1-t)^{n-i}t^i
{\bf P}_i
\end{displaymath} (74)

The Bezier curve of order n+1 (degree n) has n+1 control points. These are the first three orders of Bezier curve definitions.
   
$\displaystyle \mbox{linear}$   $\displaystyle {\bf P}(t) = (1-t){\bf P}_0 + t{\bf P}_1$ (75)
$\displaystyle \mbox{quadratic}$   $\displaystyle {\bf P}(t) = (1-t)^2{\bf P}_0 + 2(1-t)t{\bf P}_1 + t^2{\bf P}_2$ (76)
$\displaystyle \mbox{cubic}$   $\displaystyle {\bf P}(t) = (1-t)^3{\bf P}_0 + 3(1-t)^2t{\bf P}_1 +
3(1-t)t^2{\bf P}_2 + t^3{\bf P}_3$ (77)

Ways of thinking about Bezier curves

There are several useful ways in which you can think about Bezier curves. Here are the ones that I use.
Linear interpolation.
Equation 75 is obviously a linear interpolation between two points. Equation 76 can be rewritten as a linear interpolation between linear interpolations between points:

\begin{displaymath}{\bf P}(t) = (1-t)[(1-t){\bf P}_0 + t{\bf P}_1] +
t[(1-t){\bf P}_1 + t{\bf P}_2]
\end{displaymath} (78)

Equation 77 can be rewritten as a linear interpolation between linear interpolations between linear interpolations between points. This is left as an exercise for the reader.
Weighted average.
A Bezier curve can be seen as a weighted average of all of its control points. Because all of the weights are positive, and because the weights sum to one, the Bezier curve is guaranteed to lie within the convex hull of its control points.
Refinement of the control polygon.
A Bezier curve can be seen as some sort of refinement of the polygon made by connecting its control points in order. The Bezier curve starts and ends at the two end points and its shape is determined by the relative positions of the n-1 other control points, although it will generally not pass through these other control points. The tangent vectors at the start and end of the curve pass through the end point and the immediately adjacent point.
Rogers and Adams list the properties of the Bezier curve on page 291.

Continuity

You should note that each Bezier curve is independent of any other Bezier curve. If we wish two Bezier curves to join with any type of continuity, then we must explicitly position the control points of the second curve so that they bear the appropriate relationship with the control points in the first curve.

Any Bezier curve is infinitely differentiable within itself, and is therefore continuous to any degree (Cn-continuous, $\forall n$). We therefore only need concern ourselves with continuity across the joins between curves. Assume that we have two Bezier curves of the same order: ${\bf P}(t)$, defined by $({\bf P}_0,{\bf P}_1,\ldots,{\bf P}_n)$, and ${\bf Q}(t)$, defined by $({\bf Q}_0,{\bf Q}_1,\ldots,{\bf Q}_n)$. C0-continuity (continuity of position) can be achieved by setting ${\bf P}(1)={\bf Q}(0)$. This gives a formula for ${\bf Q}_0$ in terms of the ${\bf P}_i$s:

 \begin{displaymath}{\bf Q}_0={\bf P}_n.
\end{displaymath} (79)

Similarly for C1-continuity, we need C0-continuity and ${\bf P}'(1)={\bf Q}'(0)$, giving:

 \begin{displaymath}{\bf Q}_1 - {\bf Q}_0 = {\bf P}_n - {\bf P}_{n-1}
\end{displaymath} (80)

Combining Equations 80 and 79 gives a formula for ${\bf Q}_1$ in terms of the ${\bf P}_i$s:
$\displaystyle {\bf Q}_1$ = $\displaystyle 2{\bf P}_n - {\bf P}_{n-1}$ (81)
  = $\displaystyle {\bf P}_n + ({\bf P}_n-{\bf P}_{n-1})$ (82)

Continuing in this vein, we find that the requirements for C2-continuity (i.e. C1-continuity and ${\bf P}''(1)={\bf Q}''(0)$) give:

 \begin{displaymath}{\bf Q}_2 - 2{\bf Q}_1 + {\bf Q}_0 = {\bf P}_n - 2{\bf P}_{n-1} +
{\bf P}_{n-2}
\end{displaymath} (83)

Combining Equations 83, 80, and 79 gives a formula for ${\bf Q}_2$ in terms of the ${\bf P}_i$s:
$\displaystyle {\bf Q}_2$ = $\displaystyle 4{\bf P}_n - 4{\bf P}_{n-1} + {\bf P}_{n-2}$ (84)
  = $\displaystyle {\bf P}_{n-2} + 4({\bf P}_n - {\bf P}_{n-1})$ (85)

Bezier surfaces

We learnt in the IB course that the simplest way to construct a Bezier surface is as the tensor product of Bezier curves. A tensor product Bezier surface of order n+1 is defined by (n+1)2 control points. It is called a Bezier patch.

\begin{displaymath}{\bf P}(s,t)
=\sum_{i=0}^{n}
\left(\begin{array}{c}n\\ i\end{...
...{array}{c}n\\ j\end{array}\right)
(1-t)^{n-j}t^j
{\bf P}_{i,j}
\end{displaymath} (86)

You can think about this as moving the control points of one Bezier curve along a set of Bezier curves to sweep out a surface. Continuity across a boundary between two Bezier patches is only guaranteed if each of the Bezier curves across the join obey the curve continuity conditions. Again, this was covered in the IB course.


next up previous
Next: B-splines Up: Some Mathematics for Advanced Previous: Ray tracing primitives
nad@cl.cam.ac.uk