We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Draw automatically a bezierVertex
Page Index Toggle Pages: 1
Draw automatically a bezierVertex (Read 457 times)
Draw automatically a bezierVertex
Nov 8th, 2007, 1:28pm
 
Hi guys,
I just started to work with processing and now, after some weeks of sweat and success, I've got my first big problem.

I have a few predefined bezierVertex and I like to show them in an animation. At the moment the bezierVertex popping up from left to right - that's good so far.
But I also like to have each bezierVertex gets drawn from its start to its end.

This is my script so far.

float[] numbers = {
 1, 2, 3,3,1,2,1,1,3,1,2,3,3,1,2,1,2,2,1,2,3,3,1,2,1,2,2,1,2,1,2,1,2,2,1,2,3,1,2,1,1,3,
1,2,1,2,1,1,3,1,2,3,3,1,1 };
int v_faktor=10 ;
int v_links=10 ;
int v_rechts=20 ;
int i=0 ;

void setup() {
 background(255);
 smooth();
 size(600, 600);
 noFill();
}
void draw() {
 strokeWeight(numbers[i]/2);
 beginShape();
 vertex(numbers[i]+i*2, 500);
 bezierVertex( 250, 0,  0,  250, 250+i*v_faktor, 250+i*2+v_faktor);
 bezierVertex( 300, 0,  0,  300, 400+i*v_faktor, 200+i*v_faktor);
 bezierVertex( 500, 100,  200,  400, 100+i*10, 490);
 bezierVertex( 100, 300,  200,  100, numbers[i]+i*2, 100);
 bezierVertex( numbers[i]+i*2,300,  numbers[i]+i*2,  300, numbers[i]+i*2, 300);
 endShape();
 i++;
 if(i > 30) {
   noLoop();
   i = 0;
 }
 delay(5);
}

Does anyone has an idea?

Thank you!
Re: Draw automatically a bezierVertex
Reply #1 - Nov 13th, 2007, 11:17pm
 
could you better explain what you expect ??
Re: Draw automatically a bezierVertex
Reply #2 - Nov 19th, 2007, 9:17pm
 
I guess you want your bezier curves to "grow" from a short line to the whole curve?
Have a look at bezerPoint(), it lets you find points on a bezier curve. It takes a parameter 't', where 0.0 is the first, and 1.0 is the last point on the curve.
Page Index Toggle Pages: 1