Created
September 30, 2018 19:52
-
-
Save LadyScream/73b8c57eb710dd658b000f790b3bd727 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
boolean recording = false; | |
float time = 0; | |
int frame = 1; | |
void setup(){ | |
size(600, 600, P2D); | |
} | |
void draw(){ | |
if (time<=TWO_PI || !recording){ | |
background(28); | |
noFill(); | |
strokeWeight(5); | |
rectMode(CENTER); | |
float off = 0; | |
for (int i = 100; i<=width-100; i+=width/20){ | |
for (int j = 100; j<=height-100; j+=height/20){ | |
stroke(map(i,100,width-100,200,255),200,map(i,100,width-100,255,200)); | |
pushMatrix(); | |
translate(i,j); | |
rotate(off); | |
rect(0, 0, 20, 20); | |
popMatrix(); | |
off+=sin(time)/15; | |
} | |
} | |
time+=0.01; | |
if (recording && frame%2==0) save(frame+".gif"); | |
frame++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment