/*Renee Isaacs October 2nd, 2009 Rain and Leaves*/ float angle = 0.0; void setup () { noStroke(); size(500,500); background (0,0,0); smooth(); frameRate(10); leaf(50,50); //make sure the function appears in the setup } void draw() { background(0,0,0); //Ellipses for (int x = 0; x <= width; x += 10) { float y = height/1.5 +(sin(angle) * height); fill(random(0,25), random(0,80), 100); ellipse(x , y, 25, 24); angle +=10; } //Leaves for (int x = 0; x <= width; x += 12) { // the x+= is what controls how many leaves there are. float y = (sin(angle) * height); fill(random(140,255), random(100,255), 50); leaf(x , (int)y); angle +=5; //controls the sin } } //Begin Function //90,39, 26,83 original placement void leaf(int v1x, int v1y){ beginShape(); vertex (v1x,v1y); bezierVertex(v1x, v1y, v1x-46, v1y-22, v1x-64, v1y+44); bezierVertex(v1x-64, v1y+44, v1x, v1y+68, v1x, v1y); endShape(); }