Advertisement
xeromino

noc_ex1_4

Jul 2nd, 2015
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. Random generator;
  4. color c;
  5.  
  6. void setup() {
  7.   size(800, 800);
  8.   colorMode(HSB, 360, 100, 100);
  9.   background(#000000);
  10.   generator = new Random();
  11. }
  12.  
  13. void draw() {
  14.  
  15.   float meanX = width/2;
  16.   float meanY = height/2;
  17.   float rdnX = (float) generator.nextGaussian();
  18.   float rdnY = (float) generator.nextGaussian();
  19.   float sd = 10;
  20.  
  21.   float x = meanX + rdnX*sd;
  22.   float y = meanY + rdnY*sd;
  23.  
  24.   float meanC = 180;
  25.   float rdnC = (float) generator.nextGaussian();
  26.   float sdC = 100;
  27.  
  28.   c = color(meanC+rdnC*sdC, 90, 90);
  29.  
  30.   fill(c,150);
  31.   stroke(#ffffff, 100);
  32.   noStroke();
  33.   ellipse(x, y, 50, 50);
  34. }
  35.  
  36. void keyPressed() {
  37.   save(random(2123)+".jpg");
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement