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.
Page Index Toggle Pages: 1
curves (Read 514 times)
curves
Sep 24th, 2007, 1:04am
 
Hi

I am a newbie at Processing and Im trying to animate curves that spread out along the width and height of the screen in different directions--can anyone give me any tips?

I have managed to animate a line to curve

///////////////////////
int x, xspd = 5;
void setup(){
 size(400, 400);
 frameRate(30);
}

void draw(){
 for(int a=4; a<=15; a++) {
background(255);
noFill();
beginShape();
curve (width/2,x,width/2 ,height/2,height/2,a,x,a);
endShape();

 x+=xspd;
}
}
/////////////////

but I cant figure out how to make it grow from a single point---any tips would be greatly appricated!

Thanks again :)
Re: curves
Reply #1 - Sep 26th, 2007, 8:19pm
 
im not shure what you mean, but something like this?

float x, xspd = 0.1;
float x2 = 200;

void setup(){
 size(400, 400);
 frameRate(30);
}

void draw(){
 for(int a=20; a<=25; a++) {
smooth();
   background(255);
noFill();
beginShape();
curve (200+x*20,250,190,200,190,x2,200,250);
endShape();
x2 -= 0.1;
 x+=xspd;
}
}
Page Index Toggle Pages: 1