proce55or

Aleatoric lines

Feb 25th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1.  
  2. void setup() {
  3.   size(650, 650);
  4.   background(255);
  5. }
  6. void draw() {
  7.   stroke(random(50, 100), random(100, 200), random(50, 100), 80);
  8.   line(calc(1000, width), calc(1100, height), calc(1200, random(200, 400)*0.2), calc(1300, random(200, 400)*0.9));
  9. }
  10.  
  11. float calc(float a, float b) {
  12.   return abs(sin(millis()/a)*b);
  13. }
  14.  
  15. void keyPressed() {
  16.   if (key == 's') saveFrame("image-###.png");
  17. }
Advertisement
Add Comment
Please, Sign In to add comment