2

I discovered this excellent answer which contains a so beautiful plot.

I just copied the whole code and tried to reproduce the result but the contour plot used as texture looks like flipped, that is, when I see the plot from above the result is

enter image description here

and if I see it from below the result is

enter image description here

How to fix this? I mean, how to put the white color visible from the top?

I'm using Mathematica 9.

Sigur
  • 693
  • 5
  • 18
  • 1
    Add FaceForm[Opacity[1], Opacity[.8]] before Texture[..] in the definition of gr. – kglr May 28 '14 at 00:42
  • @kguler, it does not work. Your code just make the bottom white color transparent so that I can see from bottom to top; and the top gray color becomes the same. – Sigur May 28 '14 at 00:47

1 Answers1

8

Whenever you have an object in a three-dimensional scene that needs to be displayed independently of the lighting conditions, it's a good idea to give that object a Glow. From the docs:

Glow is a color component independent of simulated illumination.

This is what I use in the definition of gr (last line before Show in the answer linked in the question):

gr = Graphics3D[{Glow[White], Texture[contourPotentialPlot1], 
    EdgeForm[], 
    Polygon[{{-400, -300, level}, {400, -300, level}, {400, 300, 
       level}, {-400, 300, level}}, 
     VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, 
   Lighting -> "Neutral"];

Everything else can stay the same, and you now have the two-dimensional plot appearing bright in all directions.

Jens
  • 97,245
  • 7
  • 213
  • 499
  • Ow, thanks! It works perfectly now. Do you know why I got a different result from you or maybe there is a typo on the linked code so that plots does not correspond to that code? – Sigur May 28 '14 at 00:44
  • It's true, I get the darker appearance in the bottom view, not the top view, when no Glow is added. I'm using Mathematica version 8, what are you using? – Jens May 28 '14 at 00:47
  • I'm using version 9 on Linux. – Sigur May 28 '14 at 00:48
  • @Sigur That's a bit mysterious, but if the standard steps of restarting the Kernel and copying verbatim from the answer don't help, then it must be a version-dependent problem. Anyway, I hope the Glow method will help avoid this issue. – Jens May 28 '14 at 00:50
  • 1
    Well, I restarted the software but no progress. Your suggestion to use Glow works nice and I also used the Opacity as suggested by kguler so now I can see from bottom to top. Thanks. – Sigur May 28 '14 at 00:54
  • Oh, it could (though very unlikely) be that you set some obsolete options like LightSources in some init.m file and they could still be affecting the assumed position of the Lighting. Not sure about that, but you could experiment by trying some of the more explicitly specified settings from the documentation for Lighting and see if the results look like the pictures in the examples... – Jens May 28 '14 at 00:54
  • I never changed anything. I just installed it and started to copy some examples from here. I have no idea how to edit init.m. – Sigur May 28 '14 at 00:56
  • 1
    @Jens Have V9 and Linux too and it is not lighted from upside down. My first guess was that he messed with the Lighting options too. If not, the issue is really mysterious. – halirutan May 28 '14 at 01:17