Created
November 15, 2013 14:04
-
-
Save anonymous/7484767 to your computer and use it in GitHub Desktop.
shapes
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
| // http://beesandbombs.tumblr.com/post/65550137124/shapes | |
| // by dave | |
| void setup() { | |
| size(500, 500); | |
| noStroke(); | |
| rectMode(CENTER); | |
| } | |
| float time, x, y, d; | |
| void draw() { | |
| time = map(frameCount, 0, 48, 0, 1); | |
| background(248); | |
| fill(0); | |
| for (int i=-8; i<=8; i++) { | |
| rect(width/2 + i*25, height/2 + 20*sin(i*TWO_PI/8 + TWO_PI*time), 3, 350); | |
| rect(width/2 + 20*cos(i*TWO_PI/8 + TWO_PI*time), height/2 + i*25, 350, 3); | |
| } | |
| for (int i=-8; i<=7; i++) { | |
| for (int j=-8; j<=7; j++) { | |
| fill(0); | |
| x = width/2 + (i+.5)*25; | |
| y = height/2 + (j+.5)*25; | |
| d = map(sin(0.04*dist(x, y, width/2, height/2) - TWO_PI*time), -1, 1, 3, 10); | |
| ellipse(x, y, d, d); | |
| fill(248); | |
| if (d-4 >= 0 && (i+j)%2 == 0) | |
| ellipse(x, y, d-4, d-4); | |
| } | |
| } | |
| /*saveFrame("frame-##.png"); | |
| if (frameCount == 48) | |
| exit();*/ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment