xxxxxxxxxx
88
/* example from illustrations for AICA Schreiben Über Kunst*/
let prod = 1
prod = 10 // activate along with v1.9.2 to lag out
// prod = 5
let mainCanvas
let fb, walks = [],
walkCount = 50,
walkerToggle = true, autoPaint = true
let bg = 255 //0//[192,192,192]
function setup() {
mainCanvas = createCanvas(1754 / 3, 2480 / 3) // A5 portrait
noSmooth();
imageMode(CENTER)
pixelDensity(1.92 * prod); // 1.96, 1.97, 1
fb = createGraphics(width, height);
fb.pixelDensity(1);
fb.imageMode(CENTER);
for(let i = 0; i < walkCount; i++) {
walks.push(new Walker());
}
background(bg)
}
function draw() {
push();
translate(width / 2, height / 2);
let scl = createVector(1.0, 1.0);
image(fb, -.4, -.4, width * scl.x, height * scl.y)
pop();
if(walkerToggle) {
for(let w of walks) {
w.update();
w.c = createVector(random(width), random(height))
w.display();
}
}
let fbscl = noise(frameCount*.2)/3//.04//5099 //1.1 //1.1;
fb.resizeCanvas(width * fbscl, height * fbscl);
// console.log(fb.width, fb.height)
fb.image(mainCanvas, fb.width/2, fb.height/2, fb.width, fb.height)
}
function keyPressed() {
if(key == 'W') {
walkerToggle = !walkerToggle
}
}
class Walker {
constructor() {
this.c = createVector(width / 2, height / 2);
this.v = createVector(random(.001, .01), random(.001, .007));
this.fc = floor(random(15));
this.sw = random(.1, 4);
this.stroke = floor(random(2))*255//0 //255//
this.frameCount = floor(random(9999))
}
update() {
this.fc++;
this.c.x = noise(this.frameCount * this.v.x) * width;
this.c.y = noise(this.frameCount * this.v.y) * height;
this.stroke = 255
if(this.fc % 2 == 0) {
this.stroke = 255-bg
}
this.frameCount++
}
display() {
stroke(this.stroke)
strokeWeight(this.sw)
point(this.c.x, this.c.y)
}
}