/* L-Systems are a great simulation to explore, as there is a near infinite variety of images you can generate. In this example we calculate the L-System when we start our applet, and then alter the angle used to draw the system in the draw() method. We could just as well work with other parameters in the draw method. */ LSystem ls; void setup() { // setup the environment size(500, 500); background(0); smooth(); // setup the L-System ls = new LSystem("F", "FF-[-F+F+F]+[+F-F-F]"); // Age the L-System four generations ls.simulate(4); } void draw() { // setup the drawing area background(0); stroke(255); // figure out a theta based upon our mouse position float theta = (mouseX / (float)width) * 180.0f; // set the angle for our L-System and draw it ls.useTheta(theta); ls.render(); }