Advertisement
xeromino

col4

Oct 20th, 2014
338
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(float y) {
  2.   colorMode(HSB, 360, 100, 100);
  3.   pushMatrix();
  4.   translate(width/2, y);
  5.   float temp = map(t, t1, t2, 0, TWO_PI);
  6.   float x = 0;
  7.   for (int i=0; i<num; i++) {
  8.     pushMatrix();
  9.     rotate(TWO_PI/num*i);
  10.     //x = map(sin(temp-HALF_PI), -1, 1, 0, 100);
  11.     if (temp<PI) {
  12.       float T = ((frameCount-1.0-inFrames)/(otherFrames/2)) % 1;
  13.       x = map( ease(T, 4.0, 4.0), 0, 1, 0, 100 );
  14.     } else {
  15.       float T = ((frameCount-1.0-inFrames-otherFrames/2)/(otherFrames/2)) % 1;
  16.       x = map( ease(T, 4.0, 4.0), 0, 1, 100, 0 );
  17.     }
  18.     int col = int(360.0/num*i);
  19.     fill(col, 90, 90);
  20.     //noFill();
  21.     float arcLength = TWO_PI/num;
  22.     arc(x, 0, 95, 95, -arcLength/2, arcLength/2+radians(1));  
  23.     popMatrix();
  24.   }
  25.   fill(#000000);
  26.   float sz = map(sin(temp-HALF_PI), -1, 1, 100, 0);
  27.   ellipse(0, 0, sz, sz);
  28.   colorMode(RGB, 255);
  29.   popMatrix();
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement