I am new to Mathematica, and I am currently using it to plot 3D figures.
My problem is when I use Graphic3D
with Specularity
and try to add color gradient on top of the 3D object (in my case, a tube) using Glow
function.
Graphics3D[{Glow@ColorData["CandyColors"][#] & /@ Table[1/i, {i, 100}],
Tube[BSplineCurve[KnotData[{3, 1}, "SpaceCurve"] /@ Subdivide[0, 2 Pi, 100],
SplineClosed -> True], .4]},
Boxed -> False]
The color somehow just doesn't show.
Update
I also tried to use
Graphics3D[{Directive[Glow[ColorData["CandyColors"][#]],
Specularity[White, 10]] & /@ Range[1, 100],
Table[Tube[BSplineCurve[KnotData[{3, 1}, "SpaceCurve"] /@ Subdivide[0, 2 Pi, 100],
SplineClosed -> True], .4], {i, 1, 100}]},
Boxed -> False]
with Directive
. Also doesn't work.
Can someone please tell me what went wrong in this case?
KnotData
is pink, meaning it's not associated with a function. You need#
followed by&
somewhere. I think you meantKnotData[#, "SpaceCurve"] &
After this you'll then get errors because # will get filled in with a number from theSubdivide
andKnotData
doesn't take a number like that. You probably meantKnotData["Trefoil", "SpaceCurve"] /@ Subdivide[0, 2 Pi, 100]
$\endgroup$