Don't Copy From This Blog...
There's so much you can do with simple values. In this processing sketch, I'm only using a line and ellipse function to draw various shapes and abstract compositions on the canvas. Funny what random values can do.
void setup() //method to initialize the sketch. Only runs 1 time.
{
size(600, 600); //determines size of sketch
background(255); //background colour
smooth(); //smoothens everything out
}
void draw() //method to draw on sketch. Runs every time till program is stopped.
{
noStroke(); //circles don't have an outline
float x = random(20, 60); // random size with limits from 20 to 60
ellipse(mouseX, mouseY, x, x); // circles with position determined by mouse
fill(random(200), random(200), random(255), random(100)); // random colour and opacity
if (keyPressed) //detects if a key is pressed
{
if (key=='c'||key=='C') //now looks for key 'c'
{
background(255); //clears screen
}
}
}

| Tree using recursion |