I'd like to simulate the appearance of a diffusely reflecting plane surface illuminated by a nearby point source.

Graphics3D[{Lighting -> {{"Point", White, {0, 0, 1}}},
     {{-10, -10, 0}, 
      {-10, 10, 0}, 
      {10, 10, 0}, 
      {10, -10, 0}, 
      {-10, -10, 0}}]},
 PlotRange -> {{-10, 10}, {-10, 10}, {0, 10}},
 Axes -> True,
 AxesLabel -> {"x", "y", "z"}]

plane illuminated by point source

Notice that the sole point source is at {0,0,1}, just above the surface at its center. What should appear is that the center of the plane should appear bright (because it is near the source just above the center, and for geometric reasons) while the edges (distant portions) of the plane should appear dark. That doesn't happen.

I've adjusted properties of the specularity and such, never able to get the expected bright region in the center.

  • 1
    $\begingroup$ Ideally you shouldn't need the Specularity[] part, since this will add a glossy surface lighting (probably Phong or something similar) which creates the brightest highlight on the plane where you could see the light source (if it had an extent) mirrored instead of where the distance is closest to the surface as with diffuse lighting. I couldn't get it working with only diffuse lighting, but i think that's more at the heart of the issue. $\endgroup$ – Thies Heidecke Mar 17 '19 at 23:49
  • $\begingroup$ OK... so I'll resimulate with the specularity eliminated and re-post. Thanks. $\endgroup$ – David G. Stork Mar 17 '19 at 23:50
  • 2
    $\begingroup$ The documentation says that light from point sources does not attenuate with distance (without using the fourth list element). Without attenuation, I don't think you would expect to see the bright spot in the middle. If you were to place other objects blocking the light, then those would cast shadows, showing that there is a point source just as there should be. I don't have much time right now, my initial attempt with attenuation did not succeed, however. Also, the figure you posted no longer matches the code. $\endgroup$ – C. E. Mar 18 '19 at 5:34
  • $\begingroup$ Ah... yes... attenuation. Thanks. I will try that tomorrow. $\endgroup$ – David G. Stork Mar 18 '19 at 5:45

Thanks to @C.E., who set me on the right path:

plane = DiscretizeRegion[
  InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}}], 
  {{-1, 1}, {-1, 1}, {0, 1}}, 
  MaxCellMeasure -> {"Length" -> 0.01}, 
  BaseStyle -> {EdgeForm[], White}]; 
 Lighting -> {{"Point", White, {0, 0, 2}, {0, 0, 1}}}]

enter image description here

There's more code and coloring, but this is the ultimate figure I needed:

enter image description here

I realize why trying to render a single plane will not work: Mathematica's routines render the entire plane with a single FaceForm[], so you must break a plane into small areas, each of which can be rendered a different color/brightness. This is also why rendering a sphere is unproblematic—it consists of lots of small planes.

| improve this answer | |
  • 1
    $\begingroup$ You can add the Lighting->... option to BaseStyle in DiscretizeRegion. $\endgroup$ – kglr Mar 18 '19 at 7:14

It seems that the viewpoint direction has a lot to do with it. Here is an example, similar to yours that emphasizes the point:

n = 6; th = (2 \[Pi])/n Range[n + 1];
p = Polygon[Transpose[{Cos[th], Sin[th], ConstantArray[0, n + 1]}]];
g = Graphics3D[{Specularity[White, 10], Lighting -> {{"Point", White, {0, 0, 2}}}, 
      FaceForm[Blue], p}] 

Now, rotate the viewpoint so that you are looking directly down towards the center of the hexagon,

Show[%, Viewpoint -> {0, -\[Infinity], 0}] 

(I am a bit surprised that the y-coordinate is non-zero, not the z-coordinate)

and then perturb it a little ...

| improve this answer | |
  • $\begingroup$ This answer was in response to the original posting, with specularity. $\endgroup$ – mjw Mar 18 '19 at 0:20
  • 1
    $\begingroup$ Yes... but even with everything adjusted, your code apparently cannot yield the bright center region we know must occur. Thanks, though. $\endgroup$ – David G. Stork Mar 18 '19 at 0:27
  • $\begingroup$ Changing Lighting -> {{"Point", White, {0, 0, 2}} to Lighting -> {{"Point", White, {0, 0, 20}} turns it up pretty bright. $\endgroup$ – mjw Mar 18 '19 at 0:30
  • $\begingroup$ But placing the source point far from the surface is precisely what we shouldn't do. Even if it makes the overall image bright, it fails to give a large difference in brightness between the center and the edge. $\endgroup$ – David G. Stork Mar 18 '19 at 0:32
  • 1
    $\begingroup$ Hold a candle near your carpeted (Lambertian) floor in an otherwise dark room. THAT is what I'm trying to simulate. The sphere specularity is particularly effective when there is specular ("mirror-like") reflection from the surface—precisely what I want to avoid. And I certainly don't want to use a cylindrical or other baffle, which thwarts the physical phenomenon in question. $\endgroup$ – David G. Stork Mar 18 '19 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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