xxxxxxxxxx
82
/* example from illustrations for AICA Schreiben Über Kunst*/
let prod = 1
// prod = 10 // activate along with v1.9.2 to lag out
let fb, walks = [],
walkCount = 50,
walkerToggle = true, autoPaint = true
let bg = 255 //0//[192,192,192]
function setup() {
createCanvas(1754 / 3, 2480 / 3) // A5 portrait
fb = createImage(width, height);
noSmooth();
imageMode(CENTER)
pixelDensity(1.92 * prod); // 1.96, 1.97, 1
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();
}
}
fb = get(0, 0, width, height);
let fbscl = noise(frameCount*.2)/3//.04//5099 //1.1 //1.1;
fb.resize(fb.width * fbscl, fb.height * fbscl);
}
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)
}
}