カメラ画像を三次元の色付きボックスで表現する.

飛び出る3Dみたい.
/** * Color Box Image * * @author aa_debdeb * @date 2015/11/24 * */ import processing.video.*; Capture camera; void setup(){ size(640, 480, P3D); smooth(); camera = new Capture(this, width, height); camera.start(); } void draw(){ background(255); stroke(0); camera.loadPixels(); for(int x = 5; x < width; x += 10){ for(int y = 5; y < height; y += 10){ color rgb = camera.pixels[y * width + x]; float brightness = map(max(red(rgb), green(rgb), blue(rgb)), 0, 255, 0, 1); pushMatrix(); translate(x, y, 0 + -200 * brightness); fill(rgb); box(10, 10, 100); popMatrix(); } } }