5
$\begingroup$

I would like to make the lines opaque for a plot of form similar to:

Graphics3D[{Opacity[0.1], Line[RandomVariate[
    MultinormalDistribution[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}], 1000]]}]

enter image description here

Using opacity here doesn't seem to produce a similar effect to using an equivalent for a 2d ListPlot, where it is easier to see the layering.

ListLinePlot[
 RandomVariate[MultinormalDistribution[{0, 0}, {{1, 0}, {0, 1}}], 
 1000], PlotStyle -> {Opacity[0.4], Black}]

Does anyone know how I can recreate this similar type of effect with the 3D plot of a line?

enter image description here

$\endgroup$
  • 2
    $\begingroup$ Works fine for me on MMA 10.0.1.0. You'll probably need to add some info about your system. $\endgroup$ – N.J.Evans Jan 19 '16 at 21:17
  • $\begingroup$ Maybe I should try updating my Mathematica. At the moment am using: "10.0 for Microsoft Windows (64-bit) (September 9, 2014)" $\endgroup$ – ben18785 Jan 19 '16 at 21:19
7
$\begingroup$

This also works for me in 10.1.0 under Windows 7 x64. Take a look at your rendering settings; referencing Graphics3D: Opacity limitations this is affected by DepthPeelingLayers for example.

plot = Graphics3D[{Opacity[0.1], 
    Line[RandomVariate[
      MultinormalDistribution[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}], 1000]]}];

Table[
   Show[plot, BaseStyle -> RenderingOptions -> {"DepthPeelingLayers" -> n}],
   {n, {1, 5, 10, 20, 40, 80}}
] ~Partition~ 3 // Grid

enter image description here

Perhaps your rendering hardware simply doesn't support this method, or perhaps "Software" rendering is being used. Try specifically:

Table[
  Show[plot, BaseStyle -> RenderingOptions ->
   {"Graphics3DRenderingEngine" -> method}],
 {method, {"HardwareDepthPeeling", "BSPTree", "Software"}}
]

enter image description here

Note that on my system "Software" produces a result not too dissimilar to the one you are experiencing.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.