Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /**
  2. * Ignore Styles.
  3. * Illustration by George Brower.
  4. *
  5. * Shapes are loaded with style information that tells them how
  6. * to draw (the color, stroke weight, etc.) The disableStyle()
  7. * method of PShape turns off this information. The enableStyle()
  8. * method turns it back on.
  9. */
  10.  
  11. /* @pjs preload="stars.svg"; */
  12.  
  13. PShape star;
  14. float delta = 0.0;
  15.  
  16. void setup() {
  17. size(640, 360);
  18. star = loadShape("stars.svg");
  19. shapeMode(CENTER);
  20. }
  21.  
  22. void draw() {a
  23. background(102);
  24.  
  25. // Draw star
  26. //star.disableStyle();
  27.  
  28. //fill(0, 102, 153, random(100)); // Set the SVG fill to blue
  29. //stroke(random(255)); // Set the SVG fill to white
  30.  
  31. delta += 0.01;
  32. translate(width/2, height/2);
  33. scale(sin(frameCount/100.0));
  34. rotate(delta);
  35.  
  36. shape(star);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement