Last active
August 29, 2015 14:11
-
-
Save kuzemkon/8e7aa39bca7a71074394 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
| float x; | |
| float a=150; | |
| float b=150; | |
| float da=1; | |
| float db=2; | |
| void setup() { | |
| size(600,600,P3D); | |
| } | |
| void draw() { | |
| x+=0.1; | |
| a+=da; | |
| b+=db; | |
| if ((a > (width - 150)) || (a < 150)) da = - da; | |
| if ((b > (height - 150)) || (b < 150)) db = - db; | |
| background(50); | |
| stroke(0); | |
| fill(255); | |
| translate(a,b); | |
| rotateZ(x*PI/6); | |
| pyramide(); | |
| } | |
| void pyramide() { | |
| beginShape(); | |
| vertex(0,0,0); | |
| vertex(0,0,100); | |
| vertex(100,0,100); | |
| vertex(0,0,0); | |
| vertex(0,100,100); | |
| vertex(100,0,100); | |
| vertex(-50,-50,100); | |
| vertex(0,0,0); | |
| vertex(0,100,100); | |
| vertex(-50,-50,100); | |
| vertex(0,0,0); | |
| endShape(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment