Tuesday, February 02, 2010
Green plastic wrap 2
float r = 200;
void setup() {
size(800, 400);
background(255);
smooth();
noStroke();
}
void draw() {
if(mousePressed) {
//fill(random(100), random(100), random(100), 100);
fill(0, random(100, 255), 0, 10);
pushMatrix();
float w = mouseX;
float h = mouseY;
translate(w, h);
//r = pow(sqrt(sq(w-width/2)+sq(h-height/2)), 5/6.0);
quad(random(-r,r), random(-r,r), random(-r,r), random(-r,r),
random(-r,r), random(-r,r), random(-r,r), random(-r,r));
popMatrix();
} else {
//background(255);
}
}
void setup() {
size(800, 400);
background(255);
smooth();
noStroke();
}
void draw() {
if(mousePressed) {
//fill(random(100), random(100), random(100), 100);
fill(0, random(100, 255), 0, 10);
pushMatrix();
float w = mouseX;
float h = mouseY;
translate(w, h);
//r = pow(sqrt(sq(w-width/2)+sq(h-height/2)), 5/6.0);
quad(random(-r,r), random(-r,r), random(-r,r), random(-r,r),
random(-r,r), random(-r,r), random(-r,r), random(-r,r));
popMatrix();
} else {
//background(255);
}
}
comments

Add a comment: