Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroeth/27f5625ee87cb572b41c to your computer and use it in GitHub Desktop.
Save zeroeth/27f5625ee87cb572b41c to your computer and use it in GitHub Desktop.
inkscape spinner
/**
* Ignore Styles.
* Illustration by George Brower.
*
* Shapes are loaded with style information that tells them how
* to draw (the color, stroke weight, etc.) The disableStyle()
* method of PShape turns off this information. The enableStyle()
* method turns it back on.
*/
/* @pjs preload="stars.svg"; */
PShape star;
float delta = 0.0;
void setup() {
size(640, 360);
star = loadShape("stars.svg");
shapeMode(CENTER);
}
void draw() {
background(102);
// Draw star
//star.disableStyle();
//fill(0, 102, 153, random(100)); // Set the SVG fill to blue
//stroke(random(255)); // Set the SVG fill to white
delta += 0.01;
translate(width/2, height/2);
scale(sin(frameCount/100.0));
rotate(delta);
shape(star);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment