# How to make a gradient transparency along a curve?

In this comment on Graphic Design I was recommended to use Mathematica for creating this effect:

Imagine a bright object moving in the dark. It's only visible when its velocity below a threshold, and brightest when the velocity is zero. There is a transition phase depicting the acceleration. So the result will goes from 100% opacity to 0.

Is this possible? I know Mathematica is mostly about code, but that comment says it has mouse control on the graph too. So it would be nice to be about to control by mouse the curve, the bright points positions, and the width of the transition. I should be able to control the positions of the points.

• Related: 4847, 104692 Jun 21, 2018 at 1:05

Maybe you are looking for something like this?

curve = KnotData["Trefoil", "SpaceCurve"][t];
frame = FrenetSerretSystem[curve, t][[2]];
g = ParametricPlot3D[
curve + s frame[[3]], {t, -Pi, Pi}, {s, -r, r},
ColorFunction -> ({x, y, z, t, s} \[Function]
RGBColor[{1, 1, 1, 1/2 + 1/2 Cos[16 t]}]),
ColorFunctionScaling -> None,
Background -> Black,
Mesh -> None,
PlotPoints -> 2 {159, 35},
Axes -> False,
Boxed -> False,
ViewPoint -> {0, 0, 2}
]


• thanks, but is how can I control the bright spots? The distance between them is not the same, and it would be great to be able to control them by mouse (a slider perhaps?) Jun 20, 2018 at 15:36