Created
April 25, 2018 15:37
-
-
Save slambert/adb49d9ed9b7ceb9e8d49a9926c16aab to your computer and use it in GitHub Desktop.
modulo and ring of points working together
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 radius=200; | |
int numPoints=4; | |
void setup(){ | |
size(500,500); | |
} | |
void draw () { | |
if(frameCount % 15 == 1){ | |
numPoints = frameCount % 270; | |
} | |
background(0); | |
stroke(255); | |
strokeWeight(5); | |
pushMatrix(); | |
translate(width/2, height/2); | |
float angle=TWO_PI/(float)numPoints; | |
for(int i=0;i<numPoints;i++) | |
{ | |
point(radius*sin(angle*i),radius*cos(angle*i)); | |
} | |
popMatrix(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment