Pastebin is 300% more awesome when you are logged in. Sign Up, it's FREE!
Guest

reddit waves

By: a guest on Jun 29th, 2013  |  syntax: Java  |  size: 0.69 KB  |  hits: 74  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. int centerX = 0;
  2. int centerY = 0;
  3. int radiusX = 60;
  4. int radiusY = 60;
  5. float rotatie = 0;
  6.  
  7. void setup() {
  8.   size(800, 800);
  9.   smooth();
  10. }
  11.  
  12. void draw() {
  13.   background(255);
  14.  
  15.  
  16.  
  17.   for (int i = -50; i < width+50; i = i + 35) {
  18.  
  19.     for (int j = -50; j < width+50; j = j + 35) {
  20.      
  21.       pushMatrix();
  22.       translate(i, j);
  23.       rotate(rotatie+j*(mouseX*.000025)+i*(mouseX*.000025));
  24.      
  25.       strokeWeight(1);
  26.       stroke(0);
  27.       noFill();      
  28.       ellipse(centerX, centerY, radiusX, radiusY);
  29.      
  30.       noStroke();
  31.       fill(0);
  32.       ellipse(radiusX/2, 0, 8, 8);
  33.      
  34.       popMatrix();
  35.     }
  36.   }
  37.  
  38.   rotatie = rotatie + .1;
  39.   //println(rotatie);
  40. }