/* /// CUBE:)LOVE /// This is my final Project based on my cubelove Art and Lifestyle concept: http://www.cubelove.ch Assignement 1-4 also can be seen under: "experimente" http://www.cubelove.ch/assign1 Hop you enjoy my work!! Cubes floating Animation With Keynavigaion: x = // zoom c = // reset scale y = // move cube element v = // reset element */ //Global variables int x = 0; int y = 0; PImage gal; PImage gal1; float scaler = 1; PFont font; void setup() { size(1200,720,P3D); gal = loadImage("gal.jpg"); gal1 = loadImage("gal1.jpg"); } void draw() { background(250); image(gal, 0, 0); image(gal1, 850, 0); smooth(); lights(); translate(width/2,height/2); scale(scaler); //turn canvas 360 degrees rotateY( ((float)mouseX/width) * (PI*2)); rotateZ( ((float)mouseY/height) * (PI*2)); // first cubes /////////////////////////////////////////// stroke(150); fill(#078896); // ground level // 1row box(40); translate(0,40); box(40); translate(0,-80); box(40); // 2row translate(40,40); box(40); translate(0,40); box(40); translate(0,-80); box(40); // 3row translate(-80,40); box(40); translate(0,40); box(40); // second level // 1row translate deep translate(80,0,-40); box(40); translate(0,-40); box(40); translate(-40,40); box(40); // top level // 1row translate deep translate(40,0,-40); box(40); //Second cubes /////////////////////////////////////////// stroke(200); fill(#ecedef); translate(x,y); // ground level // 1row translate(-80,-80,80); box(40); // second level // 1row translate deep translate(0,0,-40); box(40); translate(0,40); box(40); translate(40,-40); box(40); // top level // 1row translate deep translate(-40,0,-40); box(40); translate(0,40); box(40); translate(0,40); box(40); // 2row translate(40,-40); box(40); translate(0,-40); box(40); translate(0,80); box(40); // 3row translate(40,-40); box(40); translate(0,-40); box(40); } void keyPressed() { if (key == 'x') {scaler += 0.1;} // zoom if (key == 'c') {scaler = 1;} // reset scale if(key == 'y') {x -=10; y-=10;} // move secind cube element if(key == 'v') {x =1; y =1;}// reset cube element }