/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.97unVaqMbBn/rev.1350
*
* authors:
* Adam Letts
* 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, "Jack X 1", created by Adam Letts
http://studio.sketchpad.cc/sp/pad/view/ro.9jNYnxaiXpmX3/rev.261
*/
// Pressing Control-R will render this sketch.
void setup()
{ // this is run once.
// set the background color
background(0);
// canvas size (Variable aren't evaluated. Integers only, please.)
size(450, 450);
// smooth edges
//smooth();
// limit the number of frames per second
//frameRate(1);
}
int cool2 = 0;
void draw() // this is run repeatedly.
{
background(0);
for (int cool = 0; cool < 6; cool = cool+1)
for (int jack = 9; jack >= 0; jack = jack-1)
{
int y = 200+170*sin((5*cool+cool2)*0.05);
//int z = 200+170*cos((5*cool+cool2)*0.05);
int thickness = 2 + jack*2;
int nonStickColor = 255 - jack*25;
int StickColor = 255;
if (jack > 7)
StickColor = StickColor - jack*15;
// set the width of the line.
finalthickness = 5 + 2*thickness*cos((5*cool+cool2)*0.05);
strokeWeight( finalthickness );
// set the color
if (cool%7==0)
stroke(nonStickColor, nonStickColor, StickColor, 255);
else if (cool%7==1)
stroke(nonStickColor, StickColor, nonStickColor, 255);
else if (cool%7==2)
stroke(StickColor, nonStickColor, nonStickColor, 255);
else if (cool%7==3)
stroke(StickColor, nonStickColor, StickColor, 255);
else if (cool%7==4)
stroke(StickColor, StickColor, nonStickColor, 255);
else if (cool%7==5)
stroke(nonStickColor, StickColor, StickColor, 255);
else
strokeWeight( 1 );
// draw the line
if((finalthickness <= 10) && (cool==5))
{
strokeWeight( thickness );
line(0, height/2, width, height/2);
}
else if((finalthickness > 10) && (cool==0))
{
strokeWeight( thickness );
line(0, height/2, width, height/2);
}
else
line(0, y, width, y);
//line(0, 200+200*sin((cool+cool2)*0.01), width, 40*cool+cool2);
//line(0, height, width, 0);
}
cool2 = cool2+1;
}