//import processing.opengl.*; int leng=120; float amplitude=20, rootFrequency=TWO_PI/120, frequency=rootFrequency, wanderingFrequency=rootFrequency/(12*PI), phase=0, k=0.1, mult=1; final int LOOPED=0, FIXED=1, FREE=2, MIXED=3, TOP=0, SIDE=1; int ends=LOOPED, view=2; boolean circular=true, frequencyWandering=true, frameBlending=true; color colour; color colours[]=new color[leng]; Particle particles[]=new Particle[leng]; //int sinArray[]=new int[721]; int xPos, yPos, oldxPos, oldyPos, c, i, t, colMul=2; float tinc = TWO_PI/150; float finc = TWO_PI/1000; int drawStyle=2, mode=2, frame=0, repeats=3; int dp=leng*3/4; // driver position float tension=0.5, g=0.01, damping=0.005, ff=TWO_PI/1800, fAmp=0.01, restLength=1; float dolly=120,turnRate=0.01, xRot=PI/4, yRot=0, xOld=0, yOld=0; void draw(){ //if(t<-10.0 && t>-10.2) println ("fps: " t*10000/millis()); t=0; if (frameBlending){ fill(0,4); translate(width/2, height/2, dolly+100); noStroke(); box(width,height,1); translate(-width/2, -height/2, -dolly-100); } else background(0); translate(width/2, height*0.5*(1-cos(xRot)), dolly); // 0 if cos (xRot)=1, 0.5 if cos (xRot)=0 //rotateX(xRot); //rotateY(yRot); for (int repeat=0; repeat1) repeats-=1; if (key=='-'||key=='_') { dolly-=8; background (0); } if (key=='='||key=='+') { dolly+=8; background (0); } } void mousePressed() { xOld=mouseX; yOld=mouseY; } void mouseDragged() { rootFrequency+=0.001*(mouseX-xOld); xRot-=turnRate*(mouseY-yOld); xOld=mouseX; yOld=mouseY; }