Skip to content

Commit

Permalink
Create swdc_180916.pde
Browse files Browse the repository at this point in the history
  • Loading branch information
innjesst committed Oct 3, 2018
1 parent 2635fbe commit df6801b
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions 180916_SineCircleWave/sdwc_180916/swdc_180916.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
She Draws with Code
180916
Jessica In
>> email jin@jessicain.net
>> twitter @innjesst
>> instagram @shedrawswithcode
Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license,
and indicate if changes were made. You may do so in any reasonable manner,
but not in any way that suggests the licensor endorses you or your use.
NonCommercial — You may not use the material for commercial purposes.
ShareAlike — If you remix, transform, or build upon the material, you must distribute
your contributions under the same license as the original.
No additional restrictions — You may not apply legal terms or technological measures
that legally restrict others from doing anything the license permits.
*/
int divX;
float gridX;
color bg = #084E86;
color str = 240;
color col1 = 200;

float t;

void setup() {
size(900, 900);
divX = 32;
gridX = (float)width/divX;
smooth(16);
}//setup

void draw() {
background(bg);
for (int i=0; i<=divX; i++) {
float x = x= i*gridX + gridX*0.5;
float y = height*0.5;
stroke(str);
strokeWeight(5);
point(x, y);
float dia2 = map(sin(t*2+i+1), -1, 1, 0, gridX*6);
float distFromMouse = dist(mouseX, mouseY, x, y);
float dia = map(dia2 + distFromMouse, 0, width, gridX, gridX*6);
strokeWeight(2);

noFill();
ellipse(x, y, dia, dia2);

stroke(col1);
ellipse(x, y, dia2, dia2);

}//i
float inc = map(mouseX, 0, width, 0.01, 0.06);
t = t+inc;

if (t<TWO_PI) {
// saveFrame("myFrames/frames-######.png");
}
}//draw

0 comments on commit df6801b

Please sign in to comment.