// 3d boxes -> moire effects \\ // mikkel . crone . koser \\ // http://www.beyondthree.com \\ // proce55ing.beyondthree.com \\ // a p r i l 6 t h 2 0 0 3 \\ // modifed for v0063, sept 2003 \\ // ------------------------------\\ kasse[] KasseListe; int HEIGHT = 360; int WIDTH = 360; // population int kasseHeight = 6; int num = (HEIGHT/kasseHeight); int kalpha = 20; void setup(){ size(360, 360); //noBackground(); noStroke(); // make kasseListe KasseListe = new kasse[num]; // make kasse-objects for(int i = 0; i < num; i++){ KasseListe[i] = new kasse(0, i*kasseHeight, 200, kasseHeight); // x, y, width, height, alpha } } void loop(){ background(255, 255, 255); for(int i = 0; i < num; i++){ // horisontal KasseListe[i].update(); } } class kasse{ int x, y, w, h; int count = 1; // Constructor kasse(int _x, int _y, int _w, int _h){ x = _x; // X-position y = _y; // Y-position w = _w; // width h = _h; // height } // Custom method for updating variables void update(){ push(); translate(180, 0); if(mouseY > y && mouseY < (y+h)){ if(mousePressed){ count = mouseX; }else{ count++; } //count--; fill(255, 200, 0); }else{ count++; fill(0, 0, 0, kalpha); } rotateY(count/200.0000); // set one rect(-w, y, 2*w, h); //rect(x, y, w, h); // set two push(); rotateY(PI/2); rect(-w, y, 2*w, h); //rect(x, y, w, h); pop(); pop(); } }