xxxxxxxxxx
21
let cam;
function setup() {
createCanvas(400, 400);
pixelDensity(1);
cam=createCapture(VIDEO);
cam.hide();
}
function draw() {
background(220);
// image(cam,0,0);
for(let x=0;x<width;x+=10){
for(let y=0;y<height;y+=10){
let colorFromVideo=cam.get(x,y);
fill(colorFromVideo);
rect(x,y,10,10);
}
}
}