Skip to content

Instantly share code, notes, and snippets.

@DBC-Works
Created November 14, 2020 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DBC-Works/6da1da0727283e686fe337bbc99ca359 to your computer and use it in GitHub Desktop.
Save DBC-Works/6da1da0727283e686fe337bbc99ca359 to your computer and use it in GitHub Desktop.
void setup() {
size(1280, 720, P3D);
noFill();
noiseSeed(88);
frameRate(24);
smooth();
blendMode(ADD);
sphereDetail(18);
}
final int C = 360;
final int H = C;
final int N = H / 4;
float d = 0;
float k = 0;
void draw() {
background(0);
float u = H, v = H;
for (int i = 0; i <= N; ++i) {
stroke(255 * i / N, 192, 255, 127 * i / (float)N);
float a = (TAU / C / 4) * i + d;
float x = 640 + 640 * sin(v / 100) * cos(a);
float y = 360 + 360 * sin(a) * cos(a * i / C);
if (2 <= i) {
if (k < 0.5) {
line(u, v, x, y);
}
else {
//circle(x, y, 1280 * noise(u / 1000, v / 1000) * i / (float)N);
pushMatrix();
translate(x, y, 0);
sphere(1280 * noise(u / 1000, v / 1000) * i / (float)N);
popMatrix();
}
}
u = H + H * cos(x / 100);
v = H + H * sin(y / 100);
}
d += 0.005;
k += noise(d) / 400;
if (1 < k) {
k = 0;
}
/*
saveFrame("img\\####.jpg");
if (((3 * 60) + 36) * 24 + 19 <= frameCount) {
exit();
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment