Thursday, September 25, 2008

learning processing pt2

And now I've written this one on my own using the first sketch to jog my memory when I forgot exactly what to do:

void setup() {
size (400,400);
smooth();
}

void draw() {
//background (0);
for (int i=0; i < 100; i++) {
int xPos = int(random(-width, width));
int yPos = int(random(-height, height));
int diam = int(random(30));
color col = color(random(255), random(255), random(255));
drawCircle (xPos, yPos, diam, col);
}
}

void drawCircle(int xPos, int yPos, int diam, color col) {
fill(col);
noStroke();
ellipse(xPos, yPos, diam, diam);
}

1 comment:

Jared said...

I have downloaded this processing program and I see what it can do. It's pretty cool. What is it for? What can it do or what is it good for?