Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float distY, theta;
- int num = 30;
- void setup() {
- size(500, 500);
- rectMode(CENTER);
- noStroke();
- }
- void draw() {
- background(#FEDBC5);
- translate(width/2, height/2);
- createRing(1, -100, -180, #F55835);
- createRing(1, -180, -100, #D82E48);
- createRing(1, -150, -80, #8A0A43);
- theta += .0523;
- //if (frameCount%4==0 && frameCount<121) saveFrame("image-###.gif");
- }
- void createRing(int scal, float min, float max, color f) {
- for (int i=0; i<num*scal; i++) {
- pushMatrix();
- rotate((TWO_PI/(num*scal))*i);
- distY = map(sin(theta), -1, 1, min, max);
- translate(0, distY);
- fill(f);
- rect(0, 0, (200/num)*(3-scal), (400/num)*(3-scal));
- popMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement