# How to generate shadows in Graphics3D ?

**URL:** <https://community.wolfram.com/t/how-to-generate-shadows-in-graphics3d/263>\
**Category:** Questions\
**Tags:** graphics-and-visualization\
**Created:** [July 25, 2013, 1:47am UTC](https://community.wolfram.com/t/how-to-generate-shadows-in-graphics3d/263 "2013-07-25T01:47:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradmay58](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@bradmay58](https://community.wolfram.com/u/bradmay58)\
**Post date:** [July 25, 2013, 1:47am UTC](https://community.wolfram.com/t/how-to-generate-shadows-in-graphics3d/263/1 "2013-07-25T01:47:29Z")

</div>

The Lighting and Surface Properties tutorial says “Objects do not block light sources or cast shadows, so all objects in a scene will be lit evenly by light sources.”

Is there any way to change this behavior?

For a simple example I have three polygons, the last one being horizontal (the “ground”) and a directional lighting source lighting from directly above, and I would like to interactively change the direction of the light source and observe the shadows cast by the polygons:

```auto
Graphics3D[{
  Polygon[{{0, 0, 0.4}, {1, 0, 1.4}, {0, 1, 1.4}}], 
  Polygon[{{-0.2, 0, 0.6}, {0.8, 1, 1.6}, {-0.2, 0.8, 1.6}}], 
  Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}]}, 
  Boxed -> False, Lighting -> {{"Directional", RGBColor[1, .7, .1], {{0, 0, 1}, {0, 0, 0}}}}]

```

Thanks for helping this absolute novice Mathematica user!

---

<div class="post-metadata">

**Author:** ![ruler58585](https://avatars.discourse-cdn.com/v4/letter/r/f6c823/32.png) [@ruler58585](https://community.wolfram.com/u/ruler58585)\
**Post date:** [July 25, 2013, 2:24am UTC](https://community.wolfram.com/t/how-to-generate-shadows-in-graphics3d/263/2 "2013-07-25T02:24:40Z")

</div>

Well… yes sorta, but no. Blender, or 3D program trials are your friends! Exporting geometry in a stl or obj is relatively straight forward.

References: **[Shadows in mathematica Graphics3D](http://stackoverflow.com/questions/6955692/shadows-in-mathematica-graphics3d)**

---

<div class="post-metadata">

**Author:** ![Vitaliyk](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/vitaliyk/32/45591_2.png) [@Vitaliyk](https://community.wolfram.com/u/Vitaliyk)\
**Post date:** [July 25, 2013, 3:48am UTC](https://community.wolfram.com/t/how-to-generate-shadows-in-graphics3d/263/3 "2013-07-25T03:48:12Z")

</div>

Russell gives a good pointer. But there is another recent discussion online about the shadows:

**[How to make a drop-shadow for Graphics3D objects  
 ](http://mathematica.stackexchange.com/q/938/13)**

Well, and of course, a rather spectacular implementation in pure M. can be found here:

\*\*[How can this confetti code be improved to include shadows and gravity?

![](http://i.stack.imgur.com/yiNqg.gif)  
]([http://mathematica.stackexchange.com/a/2296/13](http://mathematica.stackexchange.com/a/2296/13))\*\*
