Skip to content

Instantly share code, notes, and snippets.

@catarak
Created April 23, 2017 13:35
Show Gist options
  • Save catarak/2697ebae63ebcf37de36514fe69b1555 to your computer and use it in GitHub Desktop.
Save catarak/2697ebae63ebcf37de36514fe69b1555 to your computer and use it in GitHub Desktop.
var video;
var x = 0;
function setup() {
createCanvas(800, 240);
pixelDensity(1);
video = createCapture(VIDEO);
video.size(320, 240);
background(0);
}
function draw() {
video.loadPixels();
// image(video, 0, 0);
var w = video.width;
var h = video.height;
copy(video, w/2, 0, 1, h, x, 0, 1, h);
x = x + 1;
if (x > width) {
x = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment