//trees 1,2,3 taken from //Blprnt tree taken from //grass2 and trees 4,5 taken from import traer.physics.*; import processing.candy.*; import processing.xml.*; import processing.pdf.*; String [][] rulesets ={{"FF", "FF-[-F+F+F-]+[+F-F-F+]", "Blprnt tree" }}; ParticleSystem physics; GrowTree tree; PFont font; int choice,recframe; color s; String listname; float millisprev; void setup(){ size(400, 400); frameRate(24); choice = int(random(rulesets.length)); String [] ruleset = new String[rulesets[choice].length-2]; arraycopy(rulesets[choice], 1, ruleset, 0, rulesets[choice].length-2); int iterations = 3; tree = new GrowTree(width / 2, height, 1, rulesets[choice][0], ruleset, iterations); s = color(0); recframe = 200; millisprev = 100000; loadSVG("i/list.list"); } void draw(){ try{ //background(100); //smooth(); // exit if too slow if(frameCount > 20 && millis() > millisprev + 5000) { println("Stopped on timeout"); float step = (millis() - millisprev) / 1000; println("Sorry. Frame calculation took " + step + " seconds"); println(listname); exit(); } millisprev = millis(); if(recframe == frameCount) { beginRecord(PDF, "O8O930" + ".pdf"); drawSignet(); } pushMatrix(); translate(175,180); scale(0.11); rotate(0.2); tree.draw(); popMatrix(); if(frameCount == recframe) { endRecord(); exit(); } } // exit if error catch(Exception e){ println("Stopped on error: "); println(e); println(listname); exit(); } }