Advertisement
xeromino

digits

Mar 16th, 2017
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. int frms = 120;
  2. float theta;
  3.  
  4. void setup() {
  5.   size(540, 540);
  6. }
  7.  
  8. void draw() {
  9.   background(34);
  10.   noStroke();
  11.   textAlign(CENTER, CENTER);
  12.  
  13.   for (int j=0; j<10; j++) {
  14.     for (int i=0; i<10; i++) {
  15.       float offSetX = PI/10*i;
  16.       float offSetY = j*PI;
  17.       float x = map(i, 0, 9, width*.2, width*.8);
  18.       float y = map(j, 0, 9, height*.2, height*.8);
  19.       float offSet = map(dist(x, y, width/2, height/2), 0, width/2, 0, PI);
  20.       float ts = map(sin(theta+offSetY), -1, 1, 15, 25);
  21.       float alpha = map(ts,15,25,25,255);
  22.       fill(238, alpha);
  23.       textSize(ts);
  24.       text(i, x, y);
  25.     }
  26.   }
  27.   theta -= TWO_PI/frms;
  28.   if (frameCount<=frms) saveFrame("image-###.gif");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement