/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.FS3daLLwIY$/rev.988
*
* authors:
*
*
*
*
*
*
* Ryan Mitchell
*
*
*
*
*
*
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// Pressing Control-R will render this sketch.
float theta = 0.0, dt=1/20;
float aOsc = 2.2747, bOsc = 0.6719, cOsc = 2.9642;
float aAmp = 0.8, bAmp = 23, cAmp = 27;
int wSize = 450;
float cSize = 40;
void setup() { // this is run once.
// set the background color
background(0);
// canvas size (Integers only, please.)
size(450, 450);
// smooth edges
smooth();
// limit the number of frames per second
frameRate(30);
ellipseMode(RADIUS);
colorMode(HSB, 256);
//noStroke();
strokeWeight(4);
noFill();
}
void draw() { // this is run repeatedly.
fill((theta * 500) % 256, 150, 150, 16);
rect(0, 0, wSize, wSize);
noFill();
int count = ceil(wSize / cSize / 2);
for (int y = 0; y<count+2; y++) {
for (int x = 0; x<count+2; x++) {
stroke((theta*100 + abs((x-count/2)*(y-count/2) + 8*x + 21*y)) % 256, 150, 150);
ellipse(wSize/2 + x*(cSize + aAmp*cos(theta*aOsc)),wSize/2 + y*(cSize + aAmp*cos(theta*aOsc)), cSize + bAmp*cos(theta*bOsc)*cos(theta*cOsc), cSize + cAmp*sin(theta*bOsc)*sin(theta*cOsc));
ellipse(wSize/2 - x*(cSize + aAmp*cos(theta*aOsc)),wSize/2 - y*(cSize + aAmp*cos(theta*aOsc)), cSize + bAmp*cos(theta*bOsc)*cos(theta*cOsc), cSize + cAmp*sin(theta*bOsc)*sin(theta*cOsc));
ellipse(wSize/2 + x*(cSize + aAmp*cos(theta*aOsc)),wSize/2 - y*(cSize + aAmp*cos(theta*aOsc)), cSize + bAmp*cos(theta*bOsc)*cos(theta*cOsc), cSize + cAmp*sin(theta*bOsc)*sin(theta*cOsc));
ellipse(wSize/2 - x*(cSize + aAmp*cos(theta*aOsc)),wSize/2 + y*(cSize + aAmp*cos(theta*aOsc)), cSize + bAmp*cos(theta*bOsc)*cos(theta*cOsc), cSize + cAmp*sin(theta*bOsc)*sin(theta*cOsc));
}
}
theta+=dt;
}