23. September 2013
I wrote a little application that creates random arcs that are generated in a while-loop. On each mouse click it empties the background and redraws at the current mouse position. Try deleting "noFill()" in the setup and you'll get interesting kind of pie chart shapes.![Bildschirmfoto 2013-09-23 um 21.11.40](../../../../files/2013/09/Bildschirmfoto-2013-09-23-um-21.11.40-291x300.png)
![Bildschirmfoto 2013-09-23 um 21.11.52](../../../../files/2013/09/Bildschirmfoto-2013-09-23-um-21.11.52-291x300.png)
float arcsize;
float startrad = 0;
float endrad = 0.5;
int arccount;
void setup() {
frameRate(60);
size(600, 600);
background(33, 69, 95);
noFill();
strokeWeight(1);
stroke(255);
translate(width/2, height/2);
}
void draw() {
translate(mouseX, mouseY);
}
void arcs() {
arcsize = random(10, 590);
rotate(random(0, TWO_PI));
arc(0, 0, arcsize, arcsize, startrad, endrad);
}
void mousePressed() {
background(33, 69, 95);
while (arccount <= 80)
{
arcs();
arccount++;
}
arccount = 0;
}