//Some form of animation Starting wtih the Example from class by Ira Greenberg // the code for getting the pixels data from the image comes from // Pointillism // by Daniel Shiffman. int objCount = 200; float radius_ellipse = 2; PImage a; float[] objX = new float[objCount]; float[] objY = new float[objCount]; float[] objW = new float[objCount]; float[] objH = new float[objCount]; float[] speedX = new float[objCount]; float[] speedY = new float[objCount]; float[] accel = new float[objCount]; float[] damping = new float[objCount]; float[] friction = new float[objCount]; void setup(){ //This is where you put the path to your image a = loadImage("DSC7512.jpg"); background(255); size(452, 600); objX[i] = random(0, width); objY[i] = 0; objW[i] = radius_ellipse; objH[i] = radius_ellipse; accel[i] = random(.5); speedX[i] = random(1); damping[i] = random(.7, .99); friction[i] = .9; speedY[i] = random(3); } } void draw(){ buildDots(); } void buildDots() { noStroke(); for (int i = 0; i < objCount; i++){ color pix = a.get(round(objX[i]), round(objY[i])); println(pix); fill(pix, 126); ellipse(objX[i], objY[i], objW[i], objH[i]); objX[i] += speedX[i]; speedY[i] += accel[i]; objY[i] += speedY[i]; if (objX[i] > width || objX[i] < 0){ speedX[i] *= -1.1; } if (objY[i] > height - objH[i]/2){ speedY[i] *= -1.1; speedY[i] *= damping[i]; } } } void buildObjArray() { for (int i=0; i