Created
May 10, 2014 12:30
-
-
Save anonymous/29369ad5e91fa28dfa85 to your computer and use it in GitHub Desktop.
"Flying colours" — http://beesandbombs.tumblr.com/post/84862646749/flying-colours
This file contains 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
float th1, th2, r1 = 110, r2 = 100; | |
float d; | |
float x, y, t; | |
int N = 66; | |
float s = .0015; | |
int nf = 320; | |
float tt; | |
void setup() { | |
size(500, 500, P2D); | |
smooth(8); | |
colorMode(HSB,1); | |
noStroke(); | |
} | |
void draw() { | |
t = frameCount/float(nf); | |
background(0); | |
for (int i=0; i<N; i++) { | |
tt = (frameCount + i/3.0)/float(nf); | |
th1 = TWO_PI*(tt); | |
fill((th1/TWO_PI)%1,0.65,1); | |
th2 = -10*TWO_PI*(tt); | |
x = width/2 + r1*cos(th1) + r2*cos(th2); | |
y = height/2 + r1*sin(th1) + r2*sin(th2); | |
d = map(cos(TWO_PI*i/N),1,-1,0,6); | |
pushMatrix(); | |
translate(x,y); | |
rotate(-QUARTER_PI); | |
ellipse(0, 0, d, d*1.25); | |
popMatrix(); | |
} | |
saveFrame("f###.gif"); | |
if(frameCount==nf) | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment