Back to photostream

/*processingworkshop example by philip whitfield and martin fuchs, hyperwerk 08*/

 

float angle = 170;

float leng = 90;

 

PVector last;

float lastAngle = 0;

 

void setup(){

size(800, 650);

last = new PVector(width/2,height/2);

smooth();

background(255);

}

 

void draw(){

PVector dir;

stroke(0,80);

float pre = 1;

if(frameCount % 9 == 0 || frameCount % 7 == 0 || frameCount % 2 == 0){

pre = -1;

}

 

lastAngle += angle*pre;

dir = new PVector(sin(radians(lastAngle))*leng, cos(radians(lastAngle))*leng);

 

line(last.x, last.y, last.x+dir.x, last.y+dir.y);

last.add(dir);

}

 

void mouseClicked(){

last = new PVector(mouseX,mouseY);

}

 

void keyReleased(){

if(key == ' ')

save(day()+"_"+month()+"_"+year()+"__"+minute()+"_"+second()+".png");

if(key == 'c')

background(255);

}

 

719 views
7 faves
5 comments
Uploaded on December 9, 2008
Taken on December 9, 2008