Quite cool. Proper palette too.
this post was submitted on 17 Jul 2024
15 points (94.1% liked)
Generative Art
111 readers
1 users here now
A community for posting algorithmically generated art. Can be digital or physical.
Rules
- NO AI ART
- give credit to artist
- unless it's yourself or unkown
- Stay on topic
- Behave yourself
- No trolling, spamming etc.
- Follow lemmy.ml’s code of conduct
We also strongly recommend you mention the basic tools used so others can search for them
founded 4 years ago
MODERATORS
Awesome! Do you plan on publicly sharing the source code? I’d like to make a white on black background version.
sure, if you want. It's based on a a tutorial by "gorilla sun". I can link you to that if you prefer, or give you my code to modify directly
Please share both!
tutorial: https://www.gorillasun.de/blog/making-of-gateway/
code:
let N = 18;
function setup() {
w = min(windowWidth, windowHeight);
createCanvas(w, w);
strokeWeight(6);
compps = [];
for (n = 0; n < N; n++) {
rateOffset = map(n, 0, N, 0, 1);
compps.push(rateOffset);
}
frameRate(20);
}
let div = 6;
let radius = 100;
let rmax = 300;
let compp = 0;
let rate = 0.033;
function draw() {
// clear();
background(255, 0, 0, 40);
translate(w / 2, w / 2);
for (n = 0; n < N; n++) {
compps[n] += rate * (round(1 - compps[n], 1) + 0.05);
if (compps[n] > 1) {
compps[n] = 0;
}
shift = n*TAU / N;
radius = map(compps[n], 0, 1, 0, rmax);
for (b = shift; b < TAU + shift; b += TAU / div) {
let a = b;// * compps[n];
x = radius * cos(a);
y = radius * sin(a);
strokeLength = 20;
maxStrokeWeight = 5;
maxStrokeLength = 10;
minDist = maxStrokeLength * maxStrokeWeight;
if (radius < minDist) {
dWeight = map(radius, 0, minDist, 0, maxStrokeWeight);
strokeWeight(dWeight);
strokeLength = dWeight*maxStrokeLength;
} else {
dWeight = map(radius, minDist, rmax, maxStrokeWeight, 0);
strokeWeight(dWeight);
strokeLength = dWeight * maxStrokeLength;
}
point(x, y);
vRight = createVector(
radius * cos(a + TAU / div),
radius * sin(a + TAU / div)
);
angleRight = atan2(vRight.x - x, vRight.y - y);
vecRight = createVector(
x + strokeLength * sin(angleRight),
y + strokeLength * cos(angleRight)
);
line(x, y, vecRight.x, vecRight.y);
vLeft = createVector(
radius * cos(a - TAU / div),
radius * sin(a - TAU / div)
);
angleLeft = atan2(vLeft.x - x, vLeft.y - y);
vecLeft = createVector(
x + strokeLength * sin(angleLeft),
y + strokeLength * cos(angleLeft)
);
line(x, y, vecLeft.x, vecLeft.y);
}
}
}
Make a post if you make anything cool
Thanks! I will!
Very cool.
Like slow-motion fireworks, really cool!