Created
June 9, 2019 23:25
-
-
Save beesandbombs/f09cdc28db70199fcad4f312ceec61f6 to your computer and use it in GitHub Desktop.
tapered stroke
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is simply wonderful. Thanks for sharing!