Created
March 7, 2016 01:10
-
-
Save takawo/ff963393266bbef6d307 to your computer and use it in GitHub Desktop.
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
| void setup() { | |
| size(500, 500, P3D); | |
| colorMode(HSB, 360, 100, 100, 100); | |
| } | |
| void draw() { | |
| background(0, 0, 0); | |
| lights(); | |
| translate(width/2, height/2, -300); | |
| rotateZ(frameCount*.001); | |
| rotateY(frameCount*.01); | |
| int i = 0; | |
| for (float a2 = -180; a2 < 180; a2 += 15) { | |
| float r = sin(radians(a2+frameCount))*250; | |
| for (float a1 = 0; a1 < 360; a1 += 15) { | |
| float x = cos(radians(a1+i*7))*r; | |
| float y = sin(radians(a1+i*7))*r; | |
| float z = cos(radians(a2+i*7))*250; | |
| i++; | |
| pushMatrix(); | |
| translate(x, y, z); | |
| box(5); | |
| popMatrix(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment