Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int points = 20, frames = 240;
- float d = 180, theta=3*PI/2;
- void setup() {
- size(540, 540);
- }
- void draw() {
- background(255);
- fill(0);
- noStroke();
- beginShape();
- float arcAmount = map(sin(theta),-1,1,radians(30), radians(300));
- for (int i=0; i<points+3; i++) {
- float angle = arcAmount/points*i;
- float x = width/2 + cos(angle)*d;
- float y = height/2 + sin(angle)*d;
- curveVertex(x, y);
- }
- endShape(CLOSE);
- theta += TWO_PI/frames;
- if (frameCount<=frames) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement