// Digital Material Cube 003 // FabLab Japan // Hiroya Tanaka // Import //import processing.opengl.*; //import javax.media.opengl.*; import controlP5.*; // Array int[] arrays = new int[48*48*48]; // Field int FIELD_SIZE = 50; int FIELD_STEP = 10; // Camera float expo = 1; float rotx, roty; float rate = 0.01; // Resolution of Box public int resolution = 16; public int transparency = 0; float ratio = 0; // ControlP5 ControlP5 controlP5; // Text PFont font; long time; void setup() { size(640, 480, P3D); controlP5 = new ControlP5(this); controlP5.addSlider("resolution",1,48,10,40,200,20); controlP5.addSlider("transparency",0,100,10,65,200,20); } void draw() { background(0); // PGraphicsOpenGL pgl = (PGraphicsOpenGL)g; // Lighting ambientLight(150, 150, 150); directionalLight(255,255,255,-1,0,0); pointLight(160, 160, 160, mouseX, mouseY, 200); spotLight(100, 100, 100, mouseX, mouseY, 200, 0, 0, -1, PI, 2); // Camera rotx = rotx + (mouseY - pmouseY) * rate; roty = roty + (mouseX - pmouseX) * rate; //Text font = createFont("Meiryo", 12); textFont(font); fill(255,255,255); text("03 Visual Transparency (Random)", 10, 25); // Zoom In and Out if (keyPressed && keyCode==UP) { expo = expo + 0.01; } if (keyPressed && keyCode==DOWN) { expo = expo - 0.01; } for (int jj=0; jj