Skip to content

Instantly share code, notes, and snippets.

@0b5vr
Created October 13, 2014 04:46
Show Gist options
  • Save 0b5vr/8917ee8e36fcdcc049e3 to your computer and use it in GitHub Desktop.
Save 0b5vr/8917ee8e36fcdcc049e3 to your computer and use it in GitHub Desktop.
void star(int x,int y)
{
pushMatrix();
translate(x,y);
beginShape();
for(int i=0;i<10;i++)
{
float th=i*0.1*PI*2;
float l=30;
if(i%2==0)
{
l=10;
}
vertex(sin(th)*l,cos(th)*l);
}
endShape(CLOSE);
popMatrix();
}
void setup()
{
star(10,10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment