File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,13 +19,22 @@ order: 1
1919
2020<Iframe src = " https://flowarts.xyz" aspect = " retro" />
2121
22- For each stick, a rectangle is extruded along a curve created with a parametric equation:
22+ To create the fading trail, for each stick, a rectangle is extruded along a curve with a parametric
23+ equation:
2324
2425``` js
25- x = cos (time * handTurns) * armLength + cos (time * poiTurns) * poiLength * (startOut ? 1 : - 1 );
26- y = sin (time * handTurns) * armLength + sin (time * poiTurns) * poiLength * (startOut ? 1 : - 1 );
26+ x = cos (angle * handTurns) * armLength + cos (angle * poiTurns) * poiLength * (startOut ? 1 : - 1 );
27+ y = sin (angle * handTurns) * armLength + sin (angle * poiTurns) * poiLength * (startOut ? 1 : - 1 );
2728```
2829
29- Where ` time ` is the angle in radians between ` 0 ` and ` 2π `
30+ Where ` angle ` is in radians between ` 0 ` and ` 2π `
31+
32+ The extruded geometry's UVs are programmatically placed in a straight, horizontal row. The UVs slide
33+ along the X axis with time in the vertex shader. The UVs are then passed to the fragment shader
34+ where they drive the alpha with a smoothstep repeating on the X axis:
35+
36+ ``` glsl
37+ float alpha = smoothstep(0.75, 1.0, mod(dir * vUv.x, 1.0));
38+ ```
3039
3140<YouTube id = " zQPcupoacjM" />
You can’t perform that action at this time.
0 commit comments