// Cat Map on images PImage a; int index = 0; int i = 0; int lastx; int lasty; int iterx; int itery; void setup() { //a = loadImage("07.jpg"); //size(a.width, 100); //size(374,474); //size(299,196); framerate(30); //a = loadImage("black.jpg"); //a = loadImage("DarwinL.jpg"); a = loadImage("bacteria3.jpg"); //a = loadImage("07.jpg"); //a = loadImage("lizard72.jpg"); //a = loadImage("test.jpg"); size(720,480); //size(a.width*2,a.height*2); //size(720,480); background(140,130,143); smooth(); noStroke(); lastx = 1; lasty = 0; } void draw() { if(frameCount>=3000) { // return; } //saveFrame("darwinmap-####.tif"); /* //random points int x = int(random(a.width)); int y = int(random(a.height)); color pix = a.pixels[x+y*a.width]; fill(red(pix),green(pix),blue(pix),200); ellipse(x,y,int(random(20))+6,int(random(20))+6); */ // cat map square by square int x = (lastx+lasty)%720; int y = (lastx+2*lasty)%720; color pix = a.pixels[x+y*a.width]; fill(red(pix),green(pix),blue(pix),200); ellipse(x,y,7,7); //ellipse(x,y,int(random(20))+6,int(random(20))+6); lastx = x; lasty = y; if(frameCount%60 == 0) { //saveFrame("darwinmap-####.tif"); iterx = iterx+1%720; lastx = iterx; if(iterx == 719) { itery = itery+1%720; lasty = itery; } } if(frameCount%120 == 0) { //saveFrame("bacteriamap-####.tif"); } }