5
$\begingroup$

When more than 4 translucent objects overlap, they occlude any lines plotted behind them, no matter how small I make the opacity. Interestingly, while changing the 3D view, the line disappears behind more of the objects. Presumably some setting is changed to reduce the number of layers or something, but I don't know where this parameter is saved or how to set it.

I would be happy with a fix or a work-around. Here are two examples

(* Plot a circle *)
a1 = ParametricPlot3D[{Cos[Theta], Sin[Theta], 0}, {Theta, 0, 2 Pi}];

(* Plot 5 spheres *)
MySphere[z_, Phi_, c_] := {c Sqrt[1 - z^2] Cos[Phi], c Sqrt[1 - z^2] Sin[Phi], c z};
t0 = ParametricPlot3D[MySphere[z, Phi, 1], {z, -1, 1}, {Phi, 0, 2 Pi}, 
   Mesh -> None, PlotStyle -> Opacity[0.05]];
t1 = ParametricPlot3D[MySphere[z, Phi, 0.9], {z, -1, 1}, {Phi, 0, 2 Pi}, 
   Mesh -> None, PlotStyle -> Opacity[0.05]];
t2 = ParametricPlot3D[MySphere[z, Phi, 0.8], {z, -1, 1}, {Phi, 0, 2 Pi}, 
   Mesh -> None, PlotStyle -> Opacity[0.05]];
t3 = ParametricPlot3D[MySphere[z, Phi, 0.7], {z, -1, 1}, {Phi, 0, 2 Pi}, 
   Mesh -> None, PlotStyle -> Opacity[0.05]];
t4 = ParametricPlot3D[MySphere[z, Phi, 0.6], {z, -1, 1}, {Phi, 0, 2 Pi}, 
   Mesh -> None, PlotStyle -> Opacity[0.05]];

Show[a1, t0, t1, t2, t3, t4]

enter image description here

(* Plot a circle*)
a1 = ParametricPlot3D[{4 Cos[Theta] + 2, 4 Sin[Theta] + 2, 2}, {Theta, 0, 2 Pi}];

(* Plot a bunch of cylinders *)
g1 = Graphics3D[{EdgeForm[], Opacity[.05], Cylinder /@ RandomReal[5, {20, 2, 3}]}];
Show[g1, a1]

Output of the second code example

$\endgroup$
3
  • 2
    $\begingroup$ Looks like a bug to me. Please report it to: [email protected] $\endgroup$ Oct 11, 2022 at 16:44
  • 2
    $\begingroup$ The back side of the box frame is visible from certain viewpoints which is supposed to be behind all other objects. $\endgroup$
    – Syed
    Oct 11, 2022 at 18:50
  • $\begingroup$ Yes it's interesting that the frame is visible, but the line is not. I hope there is a work-around! I'll email Wolfram support and reply with an answer if they have a fix. $\endgroup$
    – user34722
    Oct 11, 2022 at 20:30

1 Answer 1

6
$\begingroup$

I received the following response from Wolfram technical support, which solves the issue:

"Thank you for this information, I have forwarded this question to our developers. They suggest two options:

Style[Show[a1, t0, t1, t2, t3, t4], RenderingOptions -> {"DepthPeelingLayers" -> 12}]

Style[Show[a1, t0, t1, t2, t3, t4], RenderingOptions -> {"3DRenderingMethod" -> "BSPTree"}]

"DepthPeeling" is a GPU-based method for polygon sorting, for which the number of layers is a settable parameter. "BSPTree" is a CPU-based method which is much slower to render, but has no layer limit. There may be a hardware-dependent upper limit on the number of depth peeling layers."

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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