Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. float spacer = 20;
  2.  
  3. void setup(){
  4. size(640, 640);
  5. noLoop();
  6. stroke(30, 80);
  7. }
  8.  
  9. void draw(){
  10. background(220);
  11. drawAngleGrid(0.0 + random(-1, 1));
  12. drawAngleGrid(30.0 + random(-1, 1));
  13. drawAngleGrid(60.0 + random(-1, 1));
  14. }
  15.  
  16. void drawAngleGrid(float offset){
  17. pushMatrix();
  18. rotate(radians(offset));
  19. for(float x = -width ; x < width*2 ; x += spacer){
  20. line(x, -height, x, height*2);
  21. }
  22. for(float y = -height ; y < height*2 ; y += spacer){
  23. line(-width, y, width*2, y);
  24. }
  25. popMatrix();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement