Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float theta, var, th, sw, max, r;
- void setup() {
- size(500, 300);
- strokeCap(SQUARE);
- }
- void draw() {
- background(#202020);
- max = 40;
- sw = map(sin(theta), -1, 1, 10, max);
- th = map(sin(theta), -1, 1, 0.8, 0.1);
- var = map(sin(theta), -1, 1, -0.1, 1.5);
- r = TAU/2;
- for (int i=1; i<5; i++) {
- noStroke();
- fill(#777777);
- float x = i*70+(i-1)*50;
- arc(x, height/2, 70+max, 70+max, 0, TAU);
- stroke(#FCD300);
- strokeWeight(sw);
- noFill();
- arc(x, height/2, 70+(max-sw), 70+(max-sw), i*r+PI*var, i*r+PI*(var+th));
- }
- theta += 0.0523;
- if (frameCount%2==0 && frameCount<121) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement