I made two Polygons
with different colors. Their names are p1
and p2
.
p1Color = Red;
p2Color = Green;
w = 30;
h = 40;
l = 50;
p1 = Graphics3D[{p1Color,
Polygon[{{0, 0, 0}, {0, h, 0}, {w, h, 0}, {w, 0, 0}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]},
Boxed -> False,
Lighting -> {{"Ambient", p1Color}},
RotationAction -> "Clip"];
p2 = Graphics3D[{p2Color,
Polygon[{{0, 0, l}, {0, h, l}, {w, h, l}, {w, 0, l}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]},
Boxed -> False,
Lighting -> {{"Ambient", p2Color}},
RotationAction -> "Clip"];
{p1, p2, Show[{p1, p2}]}
The output is a list of three elements, p1, p2, and the output of Show[{p1,p2}]
. The third element instead of lighting p1 an p2 with their indivdual colors mixes p2's colors with p1's colors.
Any particular reason why is this is so? How do I overcome the mixing here?
How can I specify the exact colors in the output of Show
?
Lighting
option,AbsoluteOptions[Show[{p1, p2}], Lighting]
$\endgroup$ – ssch Feb 18 '13 at 13:24Show[p1,p2,Lighting->"Neutral"]
. (If you don't specify an explicitLighting
option insideShow
,Show
takes theLighting
option value fromp1
.) $\endgroup$ – kglr Feb 18 '13 at 13:24