Created
October 24, 2012 04:25
-
-
Save jurisgalang/3943823 to your computer and use it in GitHub Desktop.
Slit camera simulation in Processing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just fire it up and dance slow in front of the camera... | |
import processing.video.*; | |
Capture device; | |
void setup() { | |
size(640, 320); | |
device = new Capture(this, width, height, 30); | |
device.start(); | |
} | |
int dx = 0; | |
int sw = 1; | |
void draw() { | |
if (!device.available() || (dx > width)) return; | |
device.read(); | |
int sx = (width / 2) - (sw / 2); | |
copy(device, sx, 0, sw, height, dx, 0, sw, height); | |
dx += sw; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment