Created
March 11, 2021 07:05
-
-
Save bogoreh/6eb4b41b93dae68a0470bac07e260c16 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
| //making the mode radians | |
| angleMode = "radians"; | |
| //declaring variable that dictates how much to spin it by | |
| var spin = 0; | |
| draw = function() { | |
| background(255); | |
| pushMatrix(); | |
| //translating baton to the middle | |
| translate(200, 200); | |
| //rotating baton | |
| rotate(PI+spin); | |
| //increasing the value of spin | |
| spin += 0.1; | |
| //drawing baton | |
| fill(127, 127, 127); | |
| stroke(0, 0, 0); | |
| line(-50, 0, 50, 0); | |
| strokeWeight(2); | |
| ellipse(-50, 0, 16, 16); | |
| ellipse(50, 0, 16, 16); | |
| popMatrix(); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment