// finger prints // author: info@toxi.co.uk // last modified: 05/10/03 // see comments below... // flag to request a new print (mouse click) boolean newPrint=false; void setup() { size(600,300); background(238,234,234); fill(238,234,234,64); stroke(20,0,60,15); } void loop() { if (newPrint) { // fade out background before drawing new print rect(0,0,width,height); randomFingerPrint(); newPrint=false; } } // create a new finger print upon mouse click void mouseReleased() { newPrint=true; } // function to draw a random finger print // pretty much all parameters are randomized but in principle // the function works by sampling the perlin noise space in // various directions (defined by LATHE_STEPS variable) // starting at random radii for each angle, the noise value is then // used to modulate/displace the grow rate of the spiral for that angle // this is repeated for the specified number of rings // each vertex is stored in the vertex list which is then used as base // to draw 10 (again slightly randomized) copies of the spiral void randomFingerPrint() { int LATHE_STEPS=(int)random(10,20); float LATHE_STEP_SIZE=TWO_PI/LATHE_STEPS; int numRings=(int)random(40,60); float xx=0,yy=0,px=0,py=0; float angle=0; float xoff=mouseX; float yoff=mouseY; float zoff=random(1000); float xscale=random(0.55,0.7); float noiseScale=random(0.05,0.2); float displace; float displaceF=random(10,20); // set number of octaves and their amplitude falloff // used by the perlin noise function noiseDetail((int)random(2,5),random(0.6)); // move to correct position translate(xoff,yoff,0); // initialize radius list // use a random radius for each angle float[] radList=new float[LATHE_STEPS]; for(int i=0; i