Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int wheelR = 300;
- float turn = 5;
- float rotation;
- void setup() {
- size(600,600);
- frameRate(24); //the rate the camera takes pictures at
- textAlign(CENTER);
- ellipseMode(CENTER);
- strokeWeight(20);
- }
- void draw() {
- fill(255);
- background(0);
- rotation = frameCount / turn;
- println(rotation);
- pushMatrix();
- translate(width/2, height/2);
- rotate(rotation * TWO_PI);
- ellipse(0,0, wheelR*2, wheelR*2);
- //draws the fist spoke in a different color (comment out for real-life setting)
- for (int i = 0; i < 5; i++) {
- if (i == 0) {
- stroke(255, 0, 200);
- } else {
- stroke(0);
- }
- line(0, 0, 0, -wheelR); //draws the first spoke upwards
- rotate(TWO_PI*1/5);
- }
- popMatrix();
- textSize(33);
- text("1/"+ int(turn), 63, 33);
- text(frameCount % 24, width-63, 33);
- }
- void mousePressed() {
- turn++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement