Advertisement
xeromino

Eye

Oct 16th, 2013
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1. int steps = 100;
  2. float theta;
  3. float radius = 200;
  4. float x, y, x2, y2, ox, oy;
  5. float inner_noise, outer_noise;
  6. color bg = #000000 ;
  7. color f = #ffffff;
  8.  
  9. void setup() {
  10.   size(500, 500);
  11.   background(bg);
  12.   stroke(f);
  13.   ox = width/2;
  14.   oy = height/2;
  15.   frameRate(20);
  16.   strokeWeight(2);
  17. }
  18.  
  19. void draw() {
  20.   fill(bg, 20);
  21.   rect(0, 0, width, height);
  22.   drawCircle();
  23. }
  24. void mouseClicked() {
  25.   setup();
  26. }
  27.  
  28. void drawCircle() {
  29.   for (int i=0; i<steps; i++) {
  30.     inner_noise = random(100, 150);
  31.     outer_noise = random(20, 70);
  32.     x = ox + cos(theta)*(radius-outer_noise);
  33.     y = oy + sin(theta)*(radius-outer_noise);
  34.     x2 = ox + cos(theta)*(radius-inner_noise);
  35.     y2 = oy + sin(theta)*(radius-inner_noise);
  36.     stroke(f, 100);
  37.     stroke(f);
  38.     line(x, y, x2, y2);
  39.     theta += TAU/steps;
  40.   }
  41.   fill(bg);
  42.   noStroke();
  43.   ellipse(ox, oy, 80, 80);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement