/** * based on scrunch / flower generator * by Mitchell Whitelaw * http://openprocessing.org/visuals/?visualID=2615 * * Copyright (C) 2009 LAFKON/Benjamin Stephan. * * This is free software, and you may redistribute it under the GPL. * This Software comes with absolutely no warranty. * For details see the license (http://www.lafkon.net/gpl.txt) * * http://www.forkable.eu/generators/wtf/i/src/flg/0_01.pde */ import traer.physics.*; import processing.pdf.*; int howmanyframes,framecount,count,countstep; int frameamount = 5; boolean record = true; boolean recording = false; String outputdir = "tmp/"; ParticleSystem PS = new ParticleSystem(0.0, 0.5); int pcount = 200; int ring_radius = 100; Particle[] Ring = new Particle[pcount]; Spring[] Innersprings = new Spring[pcount*2]; // two springs per particle Spring[] Rim = new Spring[pcount]; float spokeStrength = 0.01; float spokeDamping = 0.0; float rimDamping = 0.01; float rimStrength = 1.0; float innerspring_length = ring_radius*2.5; void setup(){ size(400,400); background(255); smooth(); buildParticles(PS); frameRate(2000); howmanyframes = int(loadStrings("tmp/gridsize.i")[0]); countstep = 500 / howmanyframes; } void draw(){ if(record == true && recording == false) { beginRecord(PDF, outputdir + "flg--" + nf(framecount,5) + ".pdf"); recording = true; framecount++; count = 0; setup(); } PS.tick(10.0/float(howmanyframes)); translate(((height/2)),((width/2))); strokeWeight(0.5); stroke(0,0,0); noFill(); beginShape(LINES); for (int p=0; p