xxxxxxxxxx
21
var capture;
var pos = 0;
function setup() {
createCanvas(1000, 300);
capture = createCapture(VIDEO);
capture.size(400, 300);
background(0);
}
function draw() {
capture.loadPixels();
var w = capture.width;
var h = capture.height;
copy(capture, w/2, 0, 1, h, pos, 0, 1, h);
pos = pos + 1;
if (pos > width) {
pos = 0;
}
}