Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

It was a shock to me when I found that in Graphics3D a surface is always transparent to the light sources:

lightSources = {{"Directional", Red, Scaled[{1/2, 1, 1}]}, 
                {"Directional", Green, Scaled[{1, 1/2, 1}]}, 
                {"Directional", Blue, Scaled[{0, 0, 0}]}};
Show[Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}, 
  Lighting -> lightSources], 
 Graphics3D[{PointSize[Large], 
   Point[lightSources[[All, 3]], 
    VertexColors -> lightSources[[All, 2]]]}]]

plot

One can see the surface on the right is blue-illumunated although this surface is completely shaded from the blue light source located at the point {0,0,-1}.

I feel such rendering is unacceptable. Is it possible to produce shadows in Mathematica?

UPDATE

To clear up: by "shadows" I mean that the surfaces on the scene must not be transparent to the light sources (or, better, their transparency could be defined by a user). I need not drop shadows shown in the linked threads: (1), (2).

share|improve this question
5  
1  
@Alexey I think you'll have to spend some time learning about POV-Ray and add the light sources and surface characteristics (material) yourself. Or perhaps you can try to export to some other 3D format and try and easier to use renderer. Maybe try kerkythea.net I used it once but not with Mathematica. – Szabolcs Jan 14 at 15:52
1  
@AlexeyPopkov That's certainly disappointing. I was just typing something like what Szaboics said, when his comment showed up. Mathematica apparently does not export the lighting and surface characteristics. – Michael E2 Jan 14 at 15:55
1  
@Sjoerd I need surface rendering but with non-transparent surfaces for the light sources. I neen not drop shadows shown in the questions you referenced. – Alexey Popkov Jan 15 at 5:39
1  
Modern graphics cards can do real-time shadows to one degree or another as evidenced by a variety of games if nothing else. This really should be possible from Mathematica, but alas the option may be absent. – Mr.Wizard Jan 15 at 8:23
show 7 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.