/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.rgYtqqNibeO/rev.129
*
* authors:
* carla s
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// This sketch builds on a prior work, "Sunflower Pattern", created by Felix Woitzel
// http://studio.sketchpad.cc/sp/pad/view/ro.9yc$gOWRZwqvl/rev.3
// this as created when adding a triangle instead of the ellipse used.
// I have been working with the triangle form and wanted to see what it would do. It is still not a trianlge but looks cool.
float theta = (1+sqrt(5))/2;
int num = 400;
float v = 0.05;
float s = 64.;
float w = 1.5;
void setup() { // this is run once.
size(512, 512);
frameRate(60);
strokeWeight(w);
stroke(256, 256, 256, 128);
}
void draw() { // this is run repeatedly.
background(0);
fill(256);
for ( int d = 0; d < num; d++) {
float l = (float)d/(float)(num-1);
l = l + millis()/1000*v;
l = l - floor(l);
pushMatrix();
translate(width/2, height/2);
rotate(-d*theta*4);
translate(l*l*width/2, 0);
float e = l*s;
triangle(0,0,e,e);
popMatrix();
}
}