import controlP5.*; ControlP5 controlP5; int spikey = 30; int complexity = 10; void setup() { controlP5 = new ControlP5(this); controlP5.addSlider("spikey",0,100,spikey,15,20,300,10); controlP5.addSlider("complexity",0,20,spikey,15,40,300,10); size(500,500); background(0); } void draw() { fill(0,2); rect(0,0,500,500); if (mousePressed) { drawFract(0, mouseX, mouseY, mouseX-pmouseX, mouseY-pmouseY); } } void drawFract(int iteration, float curX, float curY, float driftX, float driftY) { if (iteration < complexity) { float weight = 6.0/iteration; strokeWeight(weight); stroke(weight*30 + iteration*5, iteration*10+weight*60, (10-iteration)*20,200); float newx = curX-driftX; float newy = curY-driftY; line(curX, curY, newx, newy); drawFract(iteration+1, newx, newy, driftX*log(abs(mouseY-pmouseY))*spikey/50.0, driftY*log(abs(mouseX-pmouseX))*spikey/50.0); } }