xxxxxxxxxx
39
/*
Based on Alexander Miller’s video on Recreating Vintage Computer Art with Processing and inspired by John Whitney's work:
https://www.youtube.com/watch?v=LaarVR1AOvs&t=181s
*/
let t = 0;
let numLines = 100;
function setup() {
createCanvas(windowWidth, windowHeight);
strokeWeight(2);
stroke(255);
frameRate(15);
}
function draw() {
background(0);
translate(width / 2, height / 2);
let amplitude = width / 10;
for (let i = 0; i < numLines; i++) {
let x1 = sin((t + i) / 10) * amplitude / noise(t, t/200);
let y1 = cos((-t + i) / 10) * amplitude + sin(((t + 1) / 10) * 50) / noise(t, t/200);
let x2 = sin((t + i) / 20) * (amplitude * 2) + cos(t + 1) * 10 / noise(t, t*100) / noise(t, t/200);
let y2 = cos((-t + i) / 10) * (amplitude * 2) / noise(t, t/100);
line(x1, y1, x2, y2);
}
t += 0.1;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
}