xxxxxxxxxx
let capture;
//var snapshots = [];
let w, h;
let poem;
let x = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
textAlign(CENTER, CENTER);
capture = createCapture(VIDEO);
w = width;
h= height;
//capture.size(w, h);
capture.hide();
//takesnap();
poem = createVideo('https://deckard.openprocessing.org/user299507/visual2036544/h8c2c8599b9ac86d9d4c94b730125403a/IMG_2505_small.mp4', vidLoad);
poem.hide();
}
// function takesnap(){
// capture.loadPixels();
// snapshots.push(capture.get());
// //print("taken");
// }
function vidLoad(){
poem.volume(0);
poem.loop();
}
function draw() {
if (x == 0){
background(0);
textSize(width/50);
fill(255);
text("align your face with mine.",width/2, height/2);
text("follow as closely as possible.", width/2, (height /2 + width/50));
text("click to begin.", width/2, (height /2 + 2*(width/50)));
}
else{
translate(w,0);
scale(-1, 1);
tint(255, 255);
image(capture, 0, 0, w, h);
translate(w,0);
scale(-1, 1);
tint(255, 90);
image(poem, 0, 0, w, h);
}
}
function keyPressed(){
x = 1;
}
function touchStarted(){
x = 1;
}