void setup ()
size( 200, 200 );
fill( 0 );
void draw ()
background( 255 );
star( width/2, height/2, 45, 90, (frameCount%50)+2 );
void star ( int x, int y, float radius_inner, float radius_outer, int spikes )
float r = 0.0;
float res = 360.0/spikes;
float res_half = res/2;
for ( float i = 0; i < 360; i+=res )
r = -HALF_PI + radians( i );
vertex( x + cos(r) * radius_outer, y + sin(r) * radius_outer );
r = -HALF_PI + radians( i+res_half );
vertex( x + cos(r) * radius_inner, y + sin(r) * radius_inner );
endShape( CLOSE );
This sketch is running
as Java applet, exported from Processing.
Report for inappropriate content
Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)
Make a Copyright Infringement claim
function to draw a star
To tweak this sketch, first download it.
Make your updates, then upload your tweak!
OpenProcessing is an online community platform devoted to sharing and discussing Processing sketches in a collaborative, open-source environment.
To contact, send an email to:
Follow OpenProcessing on Twitter!
Blog - Feedback forum
Sketches and source code of free membership users are licensed under CC and GNU GPL.
Plus+ member sketches may
include a different license.
Most icons by somerandomdude.
Syntax highlighting and Processing brush under LGPL 3.