Skip to content

Instantly share code, notes, and snippets.

@jurisgalang
Created October 24, 2012 04:25
Show Gist options
  • Save jurisgalang/3943823 to your computer and use it in GitHub Desktop.
Save jurisgalang/3943823 to your computer and use it in GitHub Desktop.
Slit camera simulation in Processing
// 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