5
$\begingroup$

I would like to create a 3D graphic of the bust of Beethoven with specified lighting position, as well as a small (colored) set of axes. I would like the axes to not be affected by the position of the light in the rest of the figure.

bustWithLight = Show[ExampleData[{"Geometry3D","Beethoven"}],
  Lighting -> {{"Directional", 
                 RGBColor[1, 1, 1], {0, -20, -20}}}]

enter image description here

Here are the axes:

theAxes = Graphics3D[
  {Red, Thickness[0.015], Arrowheads[.05],
   Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -2.5, 0}}]],
   Green,
   Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -.5, 2}}]],
   Blue,
   Arrow[Tube[{{-3.5, -.5, 0}, {-5.5, -.5, 0}}]]},
  Lighting -> {"Ambient", White}]

enter image description here

Here they are integrated:

Show[bustWithLight, theAxes]

enter image description here

Problem: Notice that the axes are rendered as three-dimensional tubes (as they should) but "illuminated" by the lighting inherited from the bust. (This is clearest if you render then rotate the whole figure on your screen.) I would like to render the axes so they have no such inherited illumination.

I have tried a number of methods (such as above), but it seems that a final Show demands there be a single overall lighting. Is there a way to avoid this limitation?

$\endgroup$
  • $\begingroup$ You could try to Inset the inner Graphics3D. $\endgroup$ – b3m2a1 Aug 13 at 21:21
  • $\begingroup$ @b3m2a1: Inset doesn't seem to work. I've posted all my code. Can you just cut and paste and verify Inset works for you? $\endgroup$ – David G. Stork Aug 13 at 21:24
9
$\begingroup$

You can use Lighting as a directive:

theAxes2 = Graphics3D[{Lighting -> {{"Ambient", White}},  Thickness[0.015], 
    Red, Arrowheads[.05], Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -2.5, 0}}]], 
    Green, Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -.5, 2}}]],
    Blue,  Arrow[Tube[{{-3.5, -.5, 0}, {-5.5, -.5, 0}}]]}];

Show[bustWithLight, theAxes2]

enter image description here

An alternative way to give each primitive its own lighting directives is to use Style[primitivei, Lighting -> lightingi]:

theAxes3 = Graphics3D[{Thickness[0.015], Arrowheads[.05],
   MapThread[Style[#, #2, Lighting -> {{"Ambient", White}}]&, 
     {{Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -2.5, 0}}]], 
       Arrow[Tube[{{-3.5, -.5, 0}, {-3.5, -.5, 2}}]], 
       Arrow[Tube[{{-3.5, -.5, 0}, {-5.5, -.5, 0}}]]}, 
     {Red, Green, Blue}}]}];

Show[bustWithLight, theAxes3]

same picture

Both usages are documented in Lighting >> Details

enter image description here

$\endgroup$
  • $\begingroup$ Oh... you are very good at this. Thanks so much. ($\checkmark$) $\endgroup$ – David G. Stork Aug 13 at 21:40
  • $\begingroup$ @David, thank you for the accept. $\endgroup$ – kglr Aug 13 at 21:50

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.