5
$\begingroup$

Trying to learn how Opacity works, I found a possible issue. Generating points in a square spiral with:

sqrSpiral[rev_, inc_] := Module[{x, y, z, dx, dy, list = {}},
  x = y = z = 0;
  dx = {0, 1, 0, -1}; dy = {1, 0, -1, 0};
   Do[
   Do[
    list = Append[list, {x += dx[[i]], y += dy[[i]], z += inc}], {i, 4}
    ], {rev}]; list
  ]

and applying it in Graphics like so:

pts = sqrSpiral[50, 0.005];
line = Line[pts];
Graphics3D[{Thickness[0.01], Opacity[0.5], Red, line}, Boxed -> False]

gives the following strange appearence: enter image description here

As you can see, of all the overlapping lines from the current viewpoint, only the far left corners, seem to be rendered correctly. While turning the spiral as to view it from below, seem to render the lines in a more expected way.

enter image description here

Why is this the case?

(If you have an answer, please feel free to refine my procedural code:)

$\endgroup$
5
  • 1
    $\begingroup$ I suspect a problem with the hardware rendering engine. Does this help? Style[%, "RenderingOptions" -> {"Graphics3DRenderingEngine" -> "BSPTree"}] $\endgroup$ Commented Nov 9, 2014 at 16:50
  • $\begingroup$ @SimonWoods Yes, that solved the problem. If and when you have the time for it Simon, maybe you could put your code in context by adding an answer? $\endgroup$
    – MathLind
    Commented Nov 9, 2014 at 17:00
  • $\begingroup$ Looks like an issue with hardware rendering then, I suggest you submit a bug report to Wolfram. $\endgroup$ Commented Nov 9, 2014 at 17:07
  • $\begingroup$ @SimonWoods OK, I will do so and will let you know when I get an answer. $\endgroup$
    – MathLind
    Commented Nov 9, 2014 at 17:09
  • $\begingroup$ @SimonWoods I got a response from Wolfram Tech Support, see my short answer below. $\endgroup$
    – MathLind
    Commented Nov 11, 2014 at 18:52

2 Answers 2

6
$\begingroup$

This appears to be a problem with the hardware rendering engine. A workaround is to use the "BSPTree" renderer:

Style[
 Graphics3D[{Thickness[0.01], Opacity[0.5], Red, line}, Boxed -> False], 
 "RenderingOptions" -> {"Graphics3DRenderingEngine" -> "BSPTree"}]

enter image description here

$\endgroup$
1
$\begingroup$

I got an answer from Wolfram Technical Support today. They had the following to say so far:

"Our developers are aware of the problem and working to correct it."

Short and concise.

$\endgroup$

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.