xxxxxxxxxx
// createCapture();
// In this sketch we learn how to use createCapture and some of its associated functions
let capture; // create a new variable that will hold the video captured from your computer's camera
function setup() {
createCanvas(480, 480);
capture = createCapture(VIDEO); // createCapture() parameters: VIDEO, AUDIO. Default is both video AND audio together.
capture.hide(); // Don't fully know why we need this.
// Want to investigate and find out? Bonus points if you succeed! Hint: if all else fails, try the forum.
}
function draw() {
// draw an image. The image is what's being captured from the camera.
image(capture, 0, 0, width, width * capture.height / capture.width);
filter(INVERT);
}