import processing.opengl.*; import java.util.ArrayList; Particle[] pArray; private int pNum = 2500; PImage[] images; int x; int y; ArrayList galleries; PImage img; void setup(){ size (640,480,OPENGL); frameRate(30); lights(); smooth(); galleries = new ArrayList(); x = mouseX; y = mouseY; pArray = new Particle[pNum]; // String[] imageList = getFlickrImages("autumn"); //images = new PImage [25]; //for (int i=0;i width || y > height || z > 100){ // x=width/2; //y=height/2; // z= 0 ; // vx = Math.random()*5; // vy = Math.random()*5; // vz = Math.random()*5; } } private void updateVelocity() { //vx *= 1.01; //vy *= 1.01; //vz *= 1.01; //phase += phaseInc; t+=timeInc; // if (mousePressed){ // t+=timeInc // } if (t < 90){ phase = quadEaseOut((float)t,(float)0,(float)1,(float)90); } if (t>90 || t<0){ timeInc *= -1; } } public void render(){ // p.loadPixels(); //p.pixels[23] = 0xFFFFFFFF; //image(p,x,y); //noStroke(); pushMatrix(); fill(col); scale((float)phase*(float)phase*index/100); rotateZ(TWO_PI*(0.618 * index)+(float)phase); //translate(x,y,z); translate ((index * (float)phase*50) + 10, (float) (sin((float)phase)*200),0); //ellipse(pSize,pSize,pSize,pSize); //translate(width,height,0); pushMatrix(); rotateZ( index/ 5 * +(float)phase); translate(-300,-300,0); rect(0,0,600,600); //ellipse(0,0,600,600); //image(img,pSize,pSize); popMatrix(); popMatrix(); } } /* * * It's the penner bounce function! * */ public float bounceEaseOut (float t, float b, float c, float d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } } public float quadEaseIn (float t,float b,float c,float d) { return c*(t/=d)*t + b; } public float quadEaseOut (float t, float b,float c,float d){ return -c *(t/=d)*(t-2) + b; }