Skip to content

Instantly share code, notes, and snippets.

@beesandbombs
Created June 9, 2019 23:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beesandbombs/f09cdc28db70199fcad4f312ceec61f6 to your computer and use it in GitHub Desktop.
Save beesandbombs/f09cdc28db70199fcad4f312ceec61f6 to your computer and use it in GitHub Desktop.
tapered stroke
void setup(){
size(400,400,P3D);
smooth(8);
stroke(30);
noFill();
}
float q, weight, x, y;
void draw(){
background(250);
beginShape();
for(int i=0; i<=64; i++){
q = i/64.0;
x = width/2 + lerp(-120,120,q);
y = height/2 + 50*sin(PI*q - millis()*.0015);
weight = 1+16*q*(1-q);
strokeWeight(weight);
vertex(x,y);
}
endShape();
}
@hspencer
Copy link

This is simply wonderful. Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment