xxxxxxxxxx
40
let capture; //web cam feed variable
let x;
let y;
function setup() {
createCanvas(windowWidth, windowHeight); //makes canvas size of window
colorMode(HSB, 360, 100, 100, 100); //HSB color mode
frameRate(15); //changes framerate
x = 0;
y = 0;
//web cam capture set up
capture = createCapture(VIDEO);
capture.size(640, 480);
capture.hide();
}
function draw() {
background(0, 1); //semi-transparent back that adds fade effect
if (frameCount%15==0){ //captures image every second
image(capture, x, y, width*.25, height*.25);
//lay out images as a grid is adapted to fit size of window
x += width*.25;
if (x >= width){
x = 0;
y += height*.25
}
if (y >= height){
y = 0;
}
}
//filter(INVERT);
}