float xmag, tiltZ = 0; float zoom = -50; float spin, newX, newXmag = 0; PImage pic01, pic02, pic03, pic04, pic05, pic06, pic07, pic08; //carrousel c1,c2,c3,c4; carrousel c1; void setup() { size(800, 300, P3D); frameRate(30); noStroke(); colorMode(RGB); rectMode(CENTER); // Load the images into the program. I know... I'll get to it. pic01 = loadImage("01.jpg"); pic02 = loadImage("02.jpg"); pic03 = loadImage("03.jpg"); pic04 = loadImage("04.jpg"); pic05 = loadImage("05.jpg"); pic06 = loadImage("06.jpg"); pic07 = loadImage("07.jpg"); pic08 = loadImage("08.jpg"); } void draw() { background(0); //translate(width*.5, mouseY-height*.5, zoom); //centers the pictures and controls vert position /*translate(0, 0, mouseY-height*.5); rotateX(tiltZ); newX = spin/float(width) * TWO_PI; float diff = xmag-newX; if (abs(diff) > 0.01) { xmag -= diff/4.0; } */ c1 = new carrousel(xmag, 0); // c2 = new carrousel(xmag, -150); //c3 = new carrousel(xmag, 300); //c4 = new carrousel(xmag, -450); } void keyPressed() { if (keyCode == DOWN) { tiltZ -= PI*.01; } if (keyCode == UP) { tiltZ += PI*.01; } if (keyCode == RIGHT) { zoom += 10; } if (keyCode == LEFT) { zoom -= 10; } } //draws level of 8 images class carrousel{ float initialX, Ytrans; carrousel(float x, float y){ initialX = x; Ytrans = y; //translate(0,y,0); //rotateY(-x); translate(0, 0, 0); rotateX(HALF_PI*-.1); image(pic01,width*.1,height*.5); translate(0, 0, -500); rotateX(HALF_PI*-.1); image(pic02,width*.1,height*.5); } } void mouseMoved(){ // spin = spin + 1; spin=spin+(mouseX-pmouseX); }