xxxxxxxxxx
51
/*
Inspired and based on @b2renger's Noise et coordonnees polaires:
https://github.com/b2renger/p5js-designing-interactive-patterns?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp#noise-et-coordonnees-polaires
Coding Train video 3.4 Polar Coordinates (don't worry about vectors):
https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/3-angles/4-polar-coordinates
*/
let tx = 0;
let ty = 4000;
let tz = 8000;
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
stroke(255, 100);
strokeWeight(0.1);
}
function draw() {
let angle = noise(tx / 2) * TWO_PI * 2;
let minDimension = min(width, height)
let radius = noise(tx, ty, tz) * minDimension/2;
let x = cos(angle) * radius + minDimension/4 * noise(angle / 2, radius);
let y = sin(angle) * radius + minDimension/4 * noise(radius / 2, angle * radius / 2) / noise(width, height);
translate(windowWidth / 4, windowHeight / 4);
line(x, y, width/4, height/4);
line(x, y, width/2, height/4);
line(x, y, width/2, height/2);
line(x, y, width/8, height/2);
line(x, y, width/2, height/8);
line(x, y, width/4, height/4);
line(x, y, width/2, height/4);
line(x, y, width/2, height/2);
line(x, y, width/8, height/2);
line(x, y, width/2, height/8);
tx += 0.0005;
ty += 0.0005;
tz += 0.0005;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
}