/********************************************************************************* * * * Fermat's Spiral * * by Elizabeth Fuller * * * * Interactive rendering of Fermat's Spiral as a proof of concept for my * * Fiboacci bag. Basic formulas and values are derived from Mathai and Davis's * * paper, Constructing the Sunflower Head. * * * * All contents is held under a Creative Commons Attribution Non-Commercial * * Share Alike liscense * * * * for more information, visit www.itp.efuller.net * * * ********************************************************************************/ int numFlorets = 100; // number of points on the spiral Florets spiral; // class holder for the spiral PFont font; // setting up holder for the floret number labels void setup() { size(400,400); spiral = new Florets(100); spiral.init(); // setup initial base image smooth(); // set up font font = loadFont("EuphemiaUCAS-Bold-8.vlw"); } // since there is no animation and all changes occure with mouse clicks, there // is no need to do anything in the draw function void draw() {} // check if the mouse is hovering over any florets // if it is, then change the color value of the floret and its immediate // neighbors. Then, redraw the screen. void mouseClicked() { spiral.checkSetClicked(); spiral.drawFlorets(); }