Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int circleResolution;
- float radius, theta;
- void setup() {
- size(500, 300);
- background(#202020);
- colorMode(HSB,360,100,100);
- }
- void draw() {
- fill(#202020,100);
- noStroke();
- rect(0, 0, width, height);
- float div=14;
- for (int j=0; j<div;j++) {
- pushMatrix();
- translate(width/div/2+(width/div)*j, height/2);
- circleResolution = (int) map(sin(theta+(TAU/div)*j), -1, 1, 20, 40) ;
- radius = map(sin(theta+(TAU/div)*j), -1, 1, 20, 40) ;
- float angle = TWO_PI/circleResolution;
- stroke((180/div)*j,100,100,200);
- strokeWeight(1);
- for (int i=0; i<=circleResolution; i++) {
- float x = cos(HALF_PI+angle*i) * radius;
- float y = sin(HALF_PI+angle*i) * radius;
- line(0, 0, x, y);
- }
- popMatrix();
- }
- theta -= 0.0523;
- if (frameCount % 4 == 0 && frameCount < 121) saveFrame("image-###.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement