2008年5月5日 星期一

花? part 2




我找不到滑鼠離開的方法,所以變成這副德性

void setup() {
size(800, 600);
background(255);
smooth();
}

void draw(){
if (mousePressed == true)
re_todo(mouseX,mouseY);
}

void re_todo(int x,int y){
smooth();
translate(x, y); // Set initial offset
for (int i = 0; i < random(3,25); i++) { // 18 repetitions
strokeWeight(random(3,18)); // Increase stroke weight
rotate(PI/5); // Accumulate the rotation
stroke(random(0,255),random(0,255),random(0,255),180);
line(0, 0, random(15,55), 0);
}
}

沒有留言: