Join / Forgotten your password?
 
HomeFeaturesStoreForumsWikiWorkshopsJobsPortfolioGalleryEvents Members
 
> CGWiki Home       > Community Portal       > Current Events      > Recent Changes     > Random Page       > Join       > Support Forum       > Help     
 

Bezier curves

The original idea of Bezier curves came from Pierre Bezier in 1970.

Bezier Curves

Bezier curves commonly refers to cubic curves and are useful in vector oriented applications.

The idea behind bezier curves is to write the constant function 1 on the interval [0, 1] in a special way:

1  =  (1 - t + t)^3  =  (1 - t)^3 + 3(1 - t)^2 t + 3(1 - t) t^2 + t^2, \;\;\; \textrm{for} \; t\; \textrm{in}\; [0, 1].

Supose you want to draw a curve in space starting at the point \mathbf{p}_1, with a initial velocity \mathbf{v}_1 and a final point \mathbf{p}_2, with final velocity \mathbf{v}_2. A solution to this problem is: take each term in the above formula and multiply it by a vector and get

\mathbf{c}(t) = (1 - t)^3\,\mathbf{q}_1 + 3(1 - t)^2 t\,\mathbf{q}_2 + 3(1 - t) t^2\,\mathbf{q}_3 + t^3\,\mathbf{q}_4,

Now we have

\mathbf{c}(0) = \mathbf{q}_1 = \mathbf{p}_1

and

\mathbf{c}(1) = \mathbf{q}_4 = \mathbf{p}_2.

In this way

\mathbf{c}(t) = (1 - t)^3\,\mathbf{p}_1 + 3\,(1 - t)^2 t\,\mathbf{q}_2 + 3\,(1 - t) t^2\mathbf{q}_3 + t^3\mathbf{p}_2.


To take into account the initial and final velocities, take the t derivative of the above formula and evaluate it at t = 0 and t = 1.

\mathbf{c}'(t) = -3\,(1 - t)^2\mathbf{p}_1 + 3\,(-2\,(1 - t) t + (1 - t)^2)\,\mathbf{q}_2 + 3\,( 2\,(1 - t) t - t^2)\,\mathbf{q}_3 + 3\,t^2\,\mathbf{p}_2.
\mathbf{c}'(0) = -3\,\mathbf{p}_1 - 3\,\mathbf{q}_2 = \mathbf{v}_1;
\mathbf{c}'(1) = -3\,\mathbf{q}_3 + 3\,\mathbf{p}_2 = \mathbf{v}_2.


We have

3\,\mathbf{q}_2 = -3\,\mathbf{p}_1 - \mathbf{v}_1

and

3\,\mathbf{q}_3 =  3\,\mathbf{p}_2 - \mathbf{v}_2.


The Bezier curve is

\mathbf{c}(t) = (1 - t)^3\mathbf{p}_1 - (1 - t)^2t(3\,\mathbf{p}_1 + \mathbf{v}_1) + (1 - t)t^2(3\,\mathbf{p}_2 - \mathbf{v}_2) + t^3\mathbf{p}_2.

External Links

  1. http://en.wikipedia.org/wiki/Bezier_curve