Advertisement
xeromino

shell

Jan 27th, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. float segmentCount, angleStep, radius;
  2.  
  3. void setup() {
  4. size(800, 800);
  5. colorMode(HSB, 360, 100, 100);
  6. stroke(350);
  7. strokeWeight(8);
  8. }
  9.  
  10. void draw() {
  11. background(350);
  12. segmentCount = 10;
  13. angleStep=360/segmentCount;
  14.  
  15. float div = 5;
  16. radius = width/div;
  17.  
  18. beginShape(TRIANGLE_FAN);
  19. vertex(width/2, height/2);
  20. for (float angle=0;angle <=360*4; angle+=angleStep) {
  21. float vx = width/2 + cos(radians(angle))*radius;
  22. float vy = height/2 + sin(radians(angle))*radius;
  23. vertex(vx, vy);
  24. fill(angle%360, 100, 90,80);
  25. radius *=1.02;
  26. }
  27. endShape();
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement