pt pickedPoint = P(); int vc=32, kc=8, kc2, kc2LIN; // vertex and keyframe counts int k=0; // current key frame Polyloop [] CP= new Polyloop [kc]; // control polyloops Polyloop [] QCP= new Polyloop [kc*32]; // ANOTHER control polyloops...*2^5. Makes it big so that it can contain all 256 Polyloops. Polyloop [] QCPtemp= new Polyloop [kc*32]; // ANOTHER control polyloops...*2^5. Makes it big so that it can contain all 256 Polyloops. //Polyloop [] QCP_LIN= new Polyloop [kc*32]; // ANOTHER control polyloops...*2^5. Makes it big so that it can contain all 256 Polyloops. //Polyloop [] QCPtemp_LIN= new Polyloop [kc*32]; // ANOTHER control polyloops...*2^5. Makes it big so that it can contain all 256 Polyloops. Polyloop C= new Polyloop(); // used to cut and paste Polyloop P= new Polyloop(); // reference for editing Polyloop Q= new Polyloop(); // reference for editing Polyloop D= new Polyloop(); // used to capture the curve drawn by the user int style=0; // animation style: 0=stroboscopic, 1=linear, 2=... boolean showFrames=false; // toggle show all frames boolean showKeys=false; // toggle show all keys boolean animate=false; // toggle show all keys boolean showMouseProjection=false; // toggle show mouse projection boolean sketching=false; // toggle indicating that the user is sketching the selected curve boolean showVertices=true; // show control vertices boolean showEkey=true; // show edited curve float t=0; // current time for animation boolean canStart=true; boolean inLoop=true; boolean resetColorAmount=true; void myInit() { for(int i=0; i=kc*32){ t=0;} //was t>=kc*32 if(resetColorAmount){cS.reset(kc*32);resetColorAmount=false;} if(t==0)cS.first();//Is redundant, but makes sure the colors always reset properly fill(cS.next());stroke(color(121*cS.c/cS.nc,121,121));//Doing it this way allows the cS to match the t, which works out b/c both are 256 if(style==1) { println(t); if(canStart){canStart=false;doEverythingLinear();} QCP[int(t)].drawSmooth(0,5); //picture(); } // linear motion // **P04 else if(style==2) { println(t); if(canStart){canStart=false;doEverything();} QCP[int(t)].drawSmooth(0,5); //picture(); } // Four-point style animation else if(style==3) {} // smoother motion // **P04 else {stroke(red);fill(yellow); CP[int(t/32)].drawSmooth(0,5);}; // Default style: jumps from frame to frame (stroboscopic) }; }; int my_prev(int p){return(p+kc2-1)%kc2;} int my_next(int p){return(p+1)%kc2;} int my_prevLIN(int p){return(p+kc2LIN-1)%kc2LIN;} int my_nextLIN(int p){return(p+1)%kc2LIN;} void doEverythingLinear() {//linear interpolation kc2LIN=kc; for (int i=0; i