/* The Years Song by I Love Dora Piano: With every Piano chord, there are roots growing on specified points on screen Pattern: 1.2.3.4... 1.2.3.4.5. Pling: Drill: Singing: */ float mainScale=600; // factor to screen void setup() { size(600,450,P3D); colorMode(RGB,255); colorSetup(); background(brown2); //smooth(); initBranches(); } void draw() { background(brown2); updateBranches(); } void keyPressed() { if (key=='1') { branch[0].activate(0.08); } if (key=='2') { branch[1].activate(0.08); } if (key=='3') { branch[2].activate(0.08); } if (key=='4') { branch[3].activate(0.08); } if (key=='5') { branch[4].activate(0.08); } } color brown1, brown2, green1; void colorSetup() { brown1=color(51,36,9); brown2=color(42,28,4); green1=color(81,221,101); } Branch[] branch; int nrOfBranches=5; void initBranches() { branch=new Branch[nrOfBranches]; for (int i=0;itLen) {len=tLen;} trans=(7*trans)/8.0; if (len/tLen>0.98&&!children) { children=true; float cLen=tLen*0.85; if (cLen>0.02) { for (int i=0;i