Guest User

Untitled

a guest
Jun 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. void setup(){
  2. background(0);
  3. size(720,700);
  4. smooth();
  5. }
  6.  
  7. void draw(){
  8. int x1 = ceil(random(0,height/2));
  9. int y1 = ceil(random(0,width/2));
  10.  
  11. int x2 = ceil(random(0,height/2));
  12. int y2 = ceil(random(0,width/2));
  13.  
  14. int x3 = ceil(random(0,height/2));
  15. int y3 = ceil(random(0,width/2));
  16.  
  17. int h = height/2;
  18. int w = width/2;
  19.  
  20.  
  21. int r = floor(random(1,height));
  22.  
  23. if (r > h){
  24. frameRate(r/2);
  25. fill(0);
  26. noStroke();
  27. }
  28. else{
  29. frameRate(r);
  30. fill(255);
  31. //stroke(0,0,0,20); //uncomment for more detail
  32. }
  33.  
  34.  
  35. triangle(w-x1,h-y1, w-x2, h-y2, w-x3, h-y3);
  36. triangle(w+x1,h-y1, w+x2, h-y2, w+x3, h-y3);
  37.  
  38. triangle(w-x1,h+y1, w-x2, h+y2, w-x3, h+y3);
  39. triangle(w+x1,h+y1, w+x2, h+y2, w+x3, h+y3);
  40. }
Add Comment
Please, Sign In to add comment