xxxxxxxxxx
27
let cam;
function setup() {
createCanvas(640, 480);
cam = createCapture(VIDEO);
cam.hide();
}
function draw() {
background(220);
image(cam, 0, 0);
tint(255, 255);
image(cam, 0, 0);
push();
scale(-1, 1);
copy(cam, 0, 0, width / 2, height, -width, 0, width / 2, height);
pop();
tint(255, a);
image(cam, 0, 0);
a += aspeed;
if (a < 0 || a > 255) {
aspeed *= -1;
}
}