/** * 3D Pixelation * by Lukasz Karluk. * * A video image is captured, pixalated and its pixels displayed * in blocks on a 3d plane with height proportional to their brightness. * */ import processing.video.*; import processing.opengl.*; // Size of each cell in the grid int blockSize = 10; int cols; int rows; Block[][] aBlocks; float nmx, nmy; // Variable for capture device Capture video; void setup() { size(800, 600, OPENGL); frameRate(30); colorMode(RGB,255,255,255); //set up columns and rows cols = int(round(width/blockSize)); rows = int(round(height/blockSize)); aBlocks = new Block[cols][rows]; // init blocks. for(int i=0; i