xxxxxxxxxx
48
/*
----- Coding Tutorial by Patt Vira -----
Name: Text Rain (Drawing with Webcam
)
Video Tutorial: https://youtu.be/1GfKfjgf4cQ
Orginal Work by Camille Utterback & Romy Achituv (1999): http://camilleutterback.com/projects/text-rain/
Connect with Patt: @pattvira
https://www.pattvira.com/
----------------------------------------
*/
let video; let w = 320; let h = 240;
let thresholdVal = 0.30;
let t; let x, y;
let alphabets = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
let letters = [];
let num = 30;
function setup() {
createCanvas(w, h);
video = createCapture(VIDEO);
video.size(w, h);
for (let i=0; i<num; i++) {
let x = width/num * i;
let y = 1;
letters[i] = new Letter(x, y);
}
}
function draw() {
background(220);
image(video, 0, 0);
filter(THRESHOLD, thresholdVal);
for (let i=0; i<num; i++) {
letters[i].update();
letters[i].display();
}
}