Jump to content


Drawing Bezier curve


2 replies to this topic

#1 udvat

    Valued Member

  • Members
  • PipPipPip
  • 108 posts

Posted 21 April 2007 - 06:15 AM

I have used the eqn

(1-t)^3.A + 3t(1-t)^2.B +3t^2(1-t).C + t^3.D
to draw a bezier curve that is closed.

my pseudocode:

for(t=0;t<=1;t+=step)///////////////curve C1
{
draw_bezeir(A,B,C,D);
}

for(t=0;t<=1;t+=step)///////////curve C2
{
draw_bezeir(D,E,F,A);
}

that is I am drawing a closed bezeir curve using C1 and C2 with 6 control points sharing 2 endpoints.

Is it possible to do the same using one curve,that is C1?

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 21 April 2007 - 07:01 AM

You can't make a smoothly closed curve with a single cubic Bezier.

You can make a closed curve with a sharp corner with a single cubic Bezier; and you could make a smoothly closed curve with a single quartic Bezier. But quartic Beziers are uncommon. Just use two (or more) cubic Beziers; it gives you more control over the shape.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 893 posts

Posted 22 April 2007 - 12:08 PM

Cubic beziers are the way to go, since the controll points make a lot of sense for the artist. Ever thought about why all illustration tools use cubic beziers?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users