I am trying to plot a vector graph such that that vectors closest to the origin are opaque, and those furthest from the origin are transparent. I have tried using opacity with a function inside of it:
VectorPlot3D[1/(1 + Sqrt[x^2 + y^2 + z^2])
HeavisideTheta[
z - 3/2 (1/10) (x^2 + y^2)]*{1/
3 E^-z (-(1/2) Sqrt[3] Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sqrt[3] Sin[(Sqrt[3] x)/2 + y/2]),
1/3 E^-z (1/2 Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sin[(Sqrt[3] x)/2 + y/2] - Sin[y]), -(1/3)
E^-z (Cos[(Sqrt[3] x)/2 - y/2] + Cos[(Sqrt[3] x)/2 + y/2] +
Cos[y])} + 1/(1 + Sqrt[x^2 + y^2 + z^2])
HeavisideTheta[
3/2 (1/10) (x^2 + y^2) - z]*{-(1/3) E^
z (-(1/2) Sqrt[3] Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sqrt[3] Sin[(Sqrt[3] x)/2 + y/2]), -(1/3) E^
z (1/2 Sin[(Sqrt[3] x)/2 - y/2] - 1/2 Sin[(Sqrt[3] x)/2 + y/2] -
Sin[y]), -(1/3) E^
z (Cos[(Sqrt[3] x)/2 - y/2] + Cos[(Sqrt[3] x)/2 + y/2] +
Cos[y])}, {x, -1 \[Pi], 1 \[Pi]}, {y, -1.5 \[Pi], 1.5 \[Pi]}, {z, -2, 1.5}, VectorStyle -> {Black, Opacity[Function[{x,y,z},1/(1+x*y*z)]}, Axes -> True, AxesOrigin -> {0, 0, 0}, Boxed -> False, VectorPoints -> 10, ImageSize -> Large, VectorScale -> 0.04, ViewPoint -> Front]
As well as using the GrayLevel function to try and create functional dependence to just make the outer vectors more grey.
Neither of these approaches seem to be working.
VectorPlot3D[1/(1 + Sqrt[x^2 + y^2 + z^2])
HeavisideTheta[
z - 3/2 (1/10) (x^2 + y^2)]*{1/
3 E^-z (-(1/2) Sqrt[3] Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sqrt[3] Sin[(Sqrt[3] x)/2 + y/2]),
1/3 E^-z (1/2 Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sin[(Sqrt[3] x)/2 + y/2] - Sin[y]), -(1/3)
E^-z (Cos[(Sqrt[3] x)/2 - y/2] + Cos[(Sqrt[3] x)/2 + y/2] +
Cos[y])} + 1/(1 + Sqrt[x^2 + y^2 + z^2])
HeavisideTheta[
3/2 (1/10) (x^2 + y^2) - z]*{-(1/3) E^
z (-(1/2) Sqrt[3] Sin[(Sqrt[3] x)/2 - y/2] -
1/2 Sqrt[3] Sin[(Sqrt[3] x)/2 + y/2]), -(1/3) E^
z (1/2 Sin[(Sqrt[3] x)/2 - y/2] - 1/2 Sin[(Sqrt[3] x)/2 + y/2] -
Sin[y]), -(1/3) E^
z (Cos[(Sqrt[3] x)/2 - y/2] + Cos[(Sqrt[3] x)/2 + y/2] +
Cos[y])}, {x, -1 \[Pi], 1 \[Pi]}, {y, -1.5 \[Pi], 1.5 \[Pi]}, {z, -2, 1.5}, VectorStyle -> {GrayLevel[Sqrt[x^2 + y^2 + z^2]], Opacity[1]}, Axes -> True, AxesOrigin -> {0, 0, 0}, Boxed -> False, VectorPoints -> 10, ImageSize -> Large, VectorScale -> 0.04, ViewPoint -> Front]
Sorry about the lack of formatting. It got lost copying it over. Thanks in advance!