Skip to content

Instantly share code, notes, and snippets.

@bogoreh
Created March 11, 2021 07:05
Show Gist options
  • Select an option

  • Save bogoreh/6eb4b41b93dae68a0470bac07e260c16 to your computer and use it in GitHub Desktop.

Select an option

Save bogoreh/6eb4b41b93dae68a0470bac07e260c16 to your computer and use it in GitHub Desktop.
//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