/* The recursive tree uses an object that will call itself recusively to draw a tree structure at each frame. */ RecursiveTree rt; void setup() { // setup the environment size(250, 250); smooth(); // create the tree object rt = new RecursiveTree(); } void draw() { // clear the background background(0); stroke(255); // create an angle from 0 - 180 based upon our mouse position float theta = (mouseX / (float)width) * 180.0f; rt.useTheta(theta); // let the simulation do it's thing rt.simulate(); }