xxxxxxxxxx
26
let video;
let x = 0;
function setup() {
createCanvas(windowWidth, windowWidth*4/5);
pixelDensity(1);
video = createCapture(VIDEO);
video.size(windowWidth, windowWidth*4/5);
background(51);
}
function draw() {
video.loadPixels();
let w = video.width;
let h = video.height;
//copy(srcImage, sx, sy, sw, sh, dx, dy, dw, dh)
//copy(video, w/2, 0, 1, h, x, 0, 1, h);
x = x + 1;
if (x > width) {
x = 0;
}
}