Advertisement
xeromino

whatever

Apr 27th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. float x, theta, sz;
  2. int num = 45;
  3. color[] palette = {
  4.   #FF0000, #00FF00, #0000FF
  5. };
  6.  
  7. void setup() {
  8.   size(500, 500);
  9.   background(0);
  10.   noStroke();
  11.   //blendMode(SCREEN);
  12. }
  13.  
  14. void draw() {
  15.   background(0);
  16.  
  17.   translate(width/2, height/2);
  18.   for (int i=0; i<num; i++) {
  19.     float offSet = i*(TWO_PI/num);
  20.     fill(255,150);
  21.     pushMatrix();
  22.     rotate(offSet);
  23.     x = map(sin(offSet+theta), -1, 1, -100, 180);
  24.     sz = map(sin(offSet+theta),-1,1,30,70);
  25.     ellipse(x, 0, sz, sz);
  26.     popMatrix();
  27.   }
  28.   theta += 0.0523;
  29.  
  30.   //if (frameCount%2==0 && frameCount<121) saveFrame("image-###.gif");
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement