Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created December 29, 2014 17:17
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 jacobjoaquin/82b8c8e09c09c53bbc9e to your computer and use it in GitHub Desktop.
Save jacobjoaquin/82b8c8e09c09c53bbc9e to your computer and use it in GitHub Desktop.
Untitled. Built with Processing.
// Untitled
// Jacob Joaquin
// Built with Processing
float L = 20;
float offset = 0;
void setup() {
// size(500, 500, "processing.core.PGraphicsRetina2D");
size(1000, 1000);
noLoop();
noStroke();
background(0);
translate(width / 2.0, height / 2.0);
makeTheDots(150, 0, 1);
}
void makeTheDots(int countdown, float distance, int points) {
float angle = TWO_PI / float(points);
fill(offset);
offset = (offset + 12) % 256;
for (int i = 0; i < points; i++) {
PVector p = PVector.fromAngle(angle * i);
p.mult(distance);
float s = sin(i / float(points) * TWO_PI * 256 + offset);
s = map(s, -1, 1, 0, 10);
ellipse(p.x, p.y, s, s);
}
if (--countdown > 0) {
makeTheDots(countdown, distance + L * 0.5, points + 6);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment