Advertisement
xeromino

whiteout

Mar 15th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. float theta;
  2. float diam = 70;
  3. int num = 10;
  4. color[] palette = {
  5.   #FF0000, #00FF00, #0000FF
  6. };
  7.  
  8. void setup() {
  9.   size(500, 500, P2D);
  10.   background(0);
  11.   blendMode(SCREEN);
  12.   noFill();
  13. }
  14.  
  15.  
  16. void draw() {
  17.   //background(0);
  18.   fill(0,1);
  19.   noStroke();
  20.   rect(0,0,width, height);
  21.  
  22.   strokeWeight(diam/2);
  23.   float y = height/2;
  24.  
  25.   for (int i=1; i<num+1; i++) {
  26.       stroke(palette[(i-1)%3]);
  27.     float x = map(sin(theta), -1, 1, 0, width);    
  28.     ellipse(x, y, i*diam, i*diam);
  29.     ellipse(width-x, y, i*diam, i*diam);
  30.   }
  31.   theta += 0.0523/3;
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement