Skip to content

Instantly share code, notes, and snippets.

@tingham
Created October 5, 2013 17:35
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 tingham/6843906 to your computer and use it in GitHub Desktop.
Save tingham/6843906 to your computer and use it in GitHub Desktop.
int width = 512;
int height = 512;
void setup ()
{
size (width, height, P3D);
colorMode(HSB, 100);
}
void draw ()
{
float step = TWO_PI / 360;
float centerX = 256;
float centerY = 256;
for (float i = 0; i < TWO_PI; i += step) {
for (int s = 100; s > 0; s--) {
float offset = (((float)s / 100) * 64) + 32;
float x = centerX + (sin(i) * offset);
float y = centerY + (cos(i) * offset);
float h = ((float)i / TWO_PI) * 100;
stroke(h, s, 100);
strokeWeight(2);
point(x, y);
}
for (int b = 100; b > 0; b--) {
float offset = (64 + (((float)b / 100) * 64)) + 32;
float x = centerX + (sin(i) * offset);
float y = centerY + (cos(i) * offset);
float h = ((float)i / TWO_PI) * 100;
stroke(h, 100, 100 - b);
strokeWeight(2.5 + ((float)b / 100));
point(x, y);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment