import processing.opengl.*; // W:Mute 2005 // www.wmute.org psystem ps; int nump; int mode; float ay,ax,aay,aax; vector3D offset; boolean rot,firstclick,drawing; void setup(){ size(600,800,OPENGL); hint(ENABLE_OPENGL_4X_SMOOTH); background(255); colorMode(HSB); frameRate(18); strokeWeight(2); //depth(); rot=drawing=true; firstclick=true; nump=81; go(); } void go(){ mode=nump; ay=ax=0.0; aay=random(-0.01,0.01); aax=random(-0.005,0.005); ps = new psystem(nump, 200.0); offset = new vector3D(-300,-400,0); calculate(); } void calculate(){ int count=0; while (count<127){ ps.update(0.5); count++; } } void draw(){ if (drawing){ background(255); ps.draw3D(offset,mode,0.5,ay,ax); ay+=aay; ax+=aax; } } void mouseReleased(){ rot=!rot; if (rot){ drawing=true; ay=ax=0.0; aay=random(-0.01,0.01); aax=random(-0.005,0.005); } } void keyReleased(){ rot=drawing=true; go(); }