xxxxxxxxxx
89
let lion;
let w;
let hh;
let wild;
let pol
let fol
let p =1;
function setup() {
createCanvas(windowWidth, windowHeight);
let check = windowHeight%100;
// console.log('check',check);
hh = windowHeight - check
//w = 1.77*hh
w = 0.4*hh
pixelDensity(1);
lion = createVideo("IMG-1992-4 (1).mp4")
lion.loop()
//console.log(windowHeight)
//console.log(lion.height)
lion.size(w, hh)
lion.hide()
// fol = windowHeight - check
// pol = 1.77*fol
// wild = createVideo("IMG-1992-4 (1).mp4")
// wild.loop()
// //console.log(windowHeight)
// //console.log(lion.height)
// wild.size(pol, fol)
// wild.hide()
}
function draw() {
background(0);
lion.loadPixels();
loadPixels();
//console.log(hh)
for (let x = 0; x < w; x = x + 3) {
for (let y = 0; y < hh; y = y + 3) {
let i = (x + y * w) * 4;
let br = (lion.pixels[i + 0] + lion.pixels[i + 1] + lion.pixels[i + 2]) / 3
if (br > 50) {
noStroke()
if (x < 50 || y < 30) {
// stroke(random(100, 255), random(80,100), 0)
// noFill()
fill(random(100, 255), random(30, 190), random(130, 190))
} else if (x > w - 50) {
// noFill()
// stroke(random(180, 210), random(80,100), 0)
fill(random(180, 210), random(30, 190), random(130, 190))
} else {
// noFill();
// stroke(random(200, 255), random(80,255), random(0,50))
fill(random(80, 225), random(80, 225), random(80, 225))
}
rect(x - 1 + ((width / 2) - (w / 2)), y - 1, 4 / (br / 100), 4 / (br / 100))
// ellipse(x , y, 4 / (br / 100), 4 / (br / 100))
fill(205, 0, 0)
ellipse(x - 1 + ((width / 2) - (w / 2)), y - 1, (br / 100), (br / 100))
if (br < 60) {
fill(random(50, 180), 0, random(50, 100))
ellipse(x + ((width / 2) - (w / 2)), y +35, 3 / (br / 100), 3 / (br / 100))
}
// strokeWeight(1.5)
// line(x+((width/2)-(w/2)), y, x+((width/2)-(w/2))+4, y+4)
// line(x+((width/2)-(w/2))+4, y, x+((width/2)-(w/2)), y+4)
p= p +0.002
}
}
}
}