xxxxxxxxxx
129
let lion;
let w;
let hh;
let wild;
let pol
let fol
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()
lion.size(w, hh)
lion.hide()
fol = windowHeight - check
pol = 1.77*fol
wild = createVideo("gettyimages-522507667-640_adpp.mp4")
wild.loop()
wild.size(pol, fol)
wild.hide()
}
function draw() {
background(0);
lion.loadPixels();
wild.loadPixels();
loadPixels();
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
// let br2 = (wild.pixels[i + 0] + wild.pixels[i + 1] + wild.pixels[i + 2]) / 3
if (br > 50) {
noStroke()
if (x < 50 || y < 70) {
fill(random(100, 255), random(30, 190), random(30, 100))
} else if (x > w - 50) {
fill(random(180, 210), random(30, 190), random(30, 100))
} else {
fill(random(80, 225), random(80, 225), random(80, 130))
}
rect(x - 1 + ((width / 2) - (w / 2)), y - 1, 4 / (br / 100), 4 / (br / 100))
fill(255, 255, 0)
ellipse(x - 1 + ((width / 2) - (w / 2)), y - 1, (br / 100), (br / 100))
if (br < 60) {
stroke(random(50, 250), random(50, 200), 0)
strokeWeight(1.5)
line(x + ((width / 2) - (w / 2)), y + 35, x + ((width / 2) - (w / 2)) + 4, y + 4 + 35)
line(x + ((width / 2) - (w / 2)) + 4, y + 35, x + ((width / 2) - (w / 2)), y + 4 + 35)
}
}
}
}
// for (let x2 = 0; x2 < pol; x2 = x2 + 3) {
// for (let y2 = 0; y2 < fol; y2 = y2 + 3) {
// let i2 = (x2 + y2 * pol) * 4;
// let br2 = (wild.pixels[i2 + 0] + wild.pixels[i2 + 1] + wild.pixels[i2 + 2]) / 3
// if (br2 > 50) {
// noStroke()
// if (x2 < 50 || y2 < 30) {
// fill(random(100, 255), random(30, 190), random(30, 100))
// } else if (x2 > pol - 50) {
// fill(random(180, 210), random(30, 190), random(30, 100))
// } else {
// fill(random(80, 225), random(80, 225), random(80, 130))
// }
// rect(x2 - 1 + ((width / 2) - (pol / 2)), y2 - 1, 4 / (br2 / 100), 4 / (br2 / 100))
// fill(255, 255, 0)
// ellipse(x2 - 1 + ((width / 2) - (pol / 2)), y2 - 1, (br2 / 100), (br2 / 100))
// if (br2 < 60) {
// stroke(random(50, 250), random(50, 200), 0)
// strokeWeight(1.5)
// line(x2 + ((width / 2) - (pol / 2)), y2 + 35, x2 + ((width / 2) - (pol / 2)) + 4, y2 + 4 + 35)
// line(x2 + ((width / 2) - (pol / 2)) + 4, y2 + 35, x2 + ((width / 2) - (pol / 2)), y2 + 4 + 35)
// // fill(255)
// // text("fuck", x2, y2)
// }
// }
// }
// }
}