PImage img; PImage img2; float r1 = 1; float r2 = .5; void setup() { size(500,500); background(255); smooth(); img = loadImage("pr.jpg"); img2 = loadImage("helen_hunt.jpg"); } void draw() { background(255); pushMatrix(); translate(width/2,height/2); float zoom2 = map(mouseX, 0, width, 1, 4); scale(zoom2); rotate(r1); image(img2, -30, -30); popMatrix(); translate(width/2+40,height/2+40); float zoom = map(mouseX, 0, width, 1, 4.5); scale(zoom); rotate(r2); image(img, -30, -30); if(pmouseY > mouseY) { r1 += random(2)*.09; r2 += .2; } if(pmouseY < mouseY) { r1 -= .2; r2 -= .09; } if(pmouseX > mouseX) { translate(width/2+2,height/2+2); } if(pmouseX < mouseX) { translate(width/2-2,height/2-2); } }