seed = Math.random() * sq(sq(sq(int(TAU))));
mySize = min(windowWidth, windowHeight)*0.9;
createCanvas(mySize, mySize, WEBGL);
perspective(0.5, width / height, 5, 10000);
palette = random(colorScheme).colors.concat();
background(random(bgcolor));
background(random(bgcolor));
translate(0, 0, -mySize * 4.0);
switch (random([1, 2, 3])) {
rotateX(random([-1, 1]) * frameCount / 100);
rotateY(random([-1, 1]) * frameCount / 100);
rotateZ(random([-1, 1]) * frameCount / 100);
let cubeSize = mySize / (a + a / b) / 2.0;
for (let i = -cubeSize / b; i < cubeSize / b + plus; i += plus * a) {
for (let j = -cubeSize / b; j < cubeSize / b + plus; j += plus * a) {
for (let k = -cubeSize / b; k < cubeSize / b + plus; k += plus * a) {
n = noise(i * rez + t, j * rez + t, k * rez + t) * random(1, 10);
translate(i * n, j * n, k * n);
rotateX(TAU / (b * b) * random([-a, a, b, -b]) * random([a, b, a + b, b * b]));
rotateY(TAU / (b * b) * random([-a, a, b, -b]) * random([a, b, a + b, b * b]));
rotateZ(TAU / (b * b) * random([-a, a, b, -b]) * random([a, b, a + b, b * b]));
let planeSize = mySize / random([4, 16, 32, 64]);
switch (random([1, 1, 2])) {
strokeWeight(random(1, 2));
line(-planeSize / 2, -planeSize / 2, planeSize / 2, -planeSize / 2);
line(planeSize / 2, -planeSize / 2, planeSize / 2, planeSize / 2);
line(planeSize / 2, planeSize / 2, -planeSize / 2, planeSize / 2);
line(-planeSize / 2, planeSize / 2, -planeSize / 2, -planeSize / 2);
let px = plus / random(a, int(TAU)) / b / sin(n);
let py = plus / random(a, int(TAU)) / b / cos(n);
let pz = plus / random(a, int(TAU)) / b / tan(n);
rotateX(random([-1, 1]) * frameCount / 100);
rotateY(random([-1, 1]) * frameCount / 100);
rotateZ(random([-1, 1]) * frameCount / 100);
strokeWeight(random(a, b) * 2 / random(1, 100));
line(0, 0, 0, px, py, pz);
if (key === "s" || key === "S") {
saveCanvas("genuary-20250126", "png");