Advertisement
xeromino

screen

Apr 27th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. float x, theta, sz = 80;
  2. int num = 15;
  3. color[] palette = {
  4.   #FF0000, #00FF00, #0000FF
  5. };
  6.  
  7. void setup() {
  8.   size(500, 500, P2D);
  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.     fill(palette[i%3]);
  20.     pushMatrix();
  21.     rotate(i*(TWO_PI/num));
  22.     x = map(sin(theta), -1, 1, -100, 180);
  23.     ellipse(x, 0, sz, sz);
  24.     popMatrix();
  25.   }
  26.   theta += 0.0523;
  27.  
  28.   //if (frameCount<121) saveFrame("image-###.gif");
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement