xxxxxxxxxx
42
//*a very special thanks to sophia for perlin noise chats
var rot = 0;
var speed = 0.01;
function setup() {
createCanvas(720, 720);
noLoop();
}
lineCt = 57
lnDist = 11
lineLen = 7
margin = 50
function draw() {
background(255);
for (i = 0; i < lineCt; i++) {
for (j = 0; j < lineCt; j++) {
let angleLn = random(0, 360)
push();
// referenced: http://genekogan.com/code/p5js-perlin-noise/
var c = 255 * noise(0.2 * i, 0.1 * j);
if (c < 170) {
stroke(0)
} else {
stroke(255);
}
translate(margin + lnDist * i, margin + lnDist * j);
rotate(rot + angleLn)
line(-lineLen, -lineLen, lineLen, lineLen);
pop();
}
}
}
function mousePressed() {
//**thanks to Sophia for tellin me about noiseSeed and redraw :)
noiseSeed(random(0,1000));
redraw();
}