Advertisement
xeromino

col7

Oct 22nd, 2014
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. void doStuff() {
  2.   float tt = map(t, t1, t2, 0, TWO_PI);
  3.   float y = map(t, t1, t2, 50, 450);
  4.   float x = 250;
  5.   pushMatrix();
  6.   translate(x, y);
  7.   int num = 10;
  8.   for (int i=0; i<num; i++) {
  9.     pushMatrix();
  10.     rotate(PI/2+TWO_PI/num*i);
  11.     float px = cos(tt-PI/2)*map(sin(tt-PI/2), -1, 1, 0, 100);
  12.     float py = sin(tt-PI/2)*map(sin(tt-PI/2), -1, 1, 0, 100);
  13.     float scal = map(sin(tt-PI/2), -1, 1, 1, 3);
  14.     pushMatrix();
  15.     translate(px,py);
  16.     float r = map(sin(tt-PI/2),-1,1,0,TWO_PI);
  17.     float x2 = map(sin(tt-PI/2),-1,1,0,50);
  18.     float sw = map(sin(tt-PI/2),-1,1,1,20);
  19.     rotate(r);
  20.     colorMode(HSB,360,100,100);
  21.     stroke(360.0/num*i,90,90,200);
  22.     //fill(360.0/num*i,90,90,200);
  23.     strokeWeight(sw);
  24.     noFill();
  25.     arc(x2, 0, 100, 100, 0, (TWO_PI/num)*scal);
  26.     colorMode(RGB,255);
  27.     popMatrix();
  28.     popMatrix();
  29.   }
  30.   popMatrix();
  31.   noStroke();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement