3
$\begingroup$

I have the following code example:

cylinder = ContourPlot3D[y^2 + z^2 == 32, {x, 0, 5}, {y, -6, 6}, {z, -8, 8}, 
                         Mesh -> 1, ContourStyle -> FaceForm[{White, Red}, Opacity[0.0]], 
                         AxesLabel -> {"x", "y", "z"}];
areaR = ContourPlot3D[{1, 0, 0}.({x, y, z} - {0, 1.5, 1.5}) == 0, 
                      {x, 0, 5}, {y, -6, 8}, {z, -6, 8}, 
                      ContourStyle -> Directive[White], Mesh -> False];
Show[cylinder, areaR]

enter image description here

Can anyone tell me how I get the plane areaR to be White?

$\endgroup$
0

2 Answers 2

4
$\begingroup$

The lighting will always introduce deviations from the intended surface color. If you don't want this, you can override the lighting by adding Glow to the color. I'm doing this for the areaR object which represents the plane:

cylinder = 
  ContourPlot3D[y^2 + z^2 == 32, {x, 0, 5}, {y, -6, 6}, {z, -8, 8}, 
   Mesh -> 1, ContourStyle -> FaceForm[{White, Red}, Opacity[0.0]], 
   AxesLabel -> {"x", "y", "z"}];
areaR = ContourPlot3D[{1, 0, 0}.({x, y, z} - {0, 1.5, 1.5}) == 0, {x, 
    0, 5}, {y, -6, 8}, {z, -6, 8}, ContourStyle -> Directive[
     Glow[White]
     ],
   Mesh -> False];
Show[cylinder, areaR,
 Background -> Lighter[Gray],
 Lighting -> "Neutral"]

glow

The options Background -> Lighter[Gray] and Lighting -> "Neutral" aren't really necessary but I added them for clarity.

$\endgroup$
1
  • $\begingroup$ I should have thought about Glow, thanks, +1. $\endgroup$
    – Kuba
    Aug 7, 2013 at 22:37
1
$\begingroup$

It is White :)

Show[cylinder, areaR, Lighting -> "Neutral"]

enter image description here

$\endgroup$
2
  • $\begingroup$ Somehow gray ?! :) Ok, I understand it is a problem of Show and Lighting. Is there a way to combine both graphs and use different lightings for both objects (Cylinder, areaR). Something like this for the areaR: Lighting -> {{"Ambient", White}} and for the cylinder Lighting->Automatic $\endgroup$
    – user8905
    Aug 6, 2013 at 9:41
  • $\begingroup$ @user8905 I do not think so :/ but I might be wrong. $\endgroup$
    – Kuba
    Aug 6, 2013 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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