Created
December 29, 2014 17:17
-
-
Save jacobjoaquin/82b8c8e09c09c53bbc9e to your computer and use it in GitHub Desktop.
Untitled. Built with Processing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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