xxxxxxxxxx
let capture;
let colSlider
function setup() {
createCanvas(640, 480);
capture = createCapture(VIDEO);
capture.size(640, 480);
capture.hide();
}
function draw() {
background(0);
rectMode(CENTER);
let mosaic = 40;
for(let j = 0; j < height; j += mosaic) {
for(let i = 0; i < width; i += mosaic) {
let x = map(i, 0, width, 0, 640);
let y = map(j, 0, height, 0, 480);
let col = capture.get(x,y);
fill(col);
rect(i, j, 35, 35);
}
}
}