Skip to content

Instantly share code, notes, and snippets.

@gregberger
Created July 6, 2017 11:57
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 gregberger/02e8e7e845fd4ed2c57fa97987160f59 to your computer and use it in GitHub Desktop.
Save gregberger/02e8e7e845fd4ed2c57fa97987160f59 to your computer and use it in GitHub Desktop.
int qty = 14000;
float a = 0.1;
float mult;
void setup() {
size(1000, 800,P3D);
noFill();
strokeWeight(0.1);
colorMode(HSB);
mult = height/2;
}
void draw() {
background(0);
translate(width/2, height/2);
//float a = 0;
stroke(200, 50, 80, 90);
for (int k =0; k < qty; k++) {
float c = map(k,0,qty,0,360);
stroke(c,200,255,120);
float ten = (10*PI*k)/qty;
float sixteen = (16*PI*k)/qty;
float rad = (1 - 0.5*pow(cos(sixteen), 2));
float x = cos(ten)*rad*mult;
float y = sin(ten)*rad*mult;
float r = 1/200 + 0.1*pow(sin(52*PI*k/qty), 4)*mult+sin(a)*100;
ellipse(x, y, r*2, r*2);
}
a+=0.1;
/*
if(a<=TWO_PI){
saveFrame("images/#######.tiff");
}else{
stop();
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment