Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 200, frms=180;
- float angle, theta;
- float d = 150;
- void setup() {
- size(540, 540);
- noStroke();
- }
- void draw() {
- background(238);
- fill(34);
- translate(width/2, height/2);
- beginShape();
- for (int i=0; i<num; i++) {
- angle = TWO_PI/num*i;
- float offSet = PI/num*i;
- float sc = map(sin(theta+offSet*2), -1, 1, 0.5, 1);
- float x = sin(angle+offSet*3*sc)*d*sc;
- float y = cos(angle+offSet*sc)*d*sc;
- vertex(x, y);
- }
- endShape(CLOSE);
- theta += TWO_PI/frms;
- if (frameCount<frms) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement