Example 1: Webcam Mirror
Code
let cam;
function setup() {
createCanvas(400, 400);
cam = createCapture(VIDEO);
cam.size(400, 400);
cam.hide();
}
function draw() {
background(0);
push();
translate(width, 0);
scale(-1, 1);
image(cam, 0, 0, width, height);
pop();
noFill();
stroke(255, 60, 145);
strokeWeight(3);
circle(mouseX, mouseY, 50);
}
Try this: Draw simple overlays on top of the mirrored feed.