Sorry, I didn't mentioned clearly in my earlier post.

I want to build a transparent Rectangle, within which I want to diffuse a certain color of my choice which is also transparent. After this, any objects that I place inside the transparent building should be visible in its assigned color. One of the things that I tried to do after making a rectangle shape with light colored walls was to place Points with ImageSize-> {20, 20} and different colors. For that purpose I wrote the following code.

w = 100;
l = 200;
h = 30;
f = Graphics3D[{Transparent,Polygon[{{0, 0, 0}, {w, 0, 0}, {w, 0, h}, {0, 0, h}}]},
      Lighting -> {LightBlue}, Boxed -> False];
b = Graphics3D[{Transparent,Polygon[{{0, l, 0}, {w, l, 0}, {w, l, h}, {0, l, h}}]},
      Lighting -> {LightBlue}, Boxed -> False];
s1 = Graphics3D[{Transparent,Polygon[{{0, 0, 0}, {0, 0, h}, {0, l, h}, {0, l, 0}}]}, 
       Lighting -> {LightBlue}, Boxed -> False];
s2 = Graphics3D[{Transparent,Polygon[{{w, 0, 0}, {w, 0, h}, {w, l, h}, {w, l, 0}}]}, 
       Lighting -> {LightBlue}, Boxed -> False];
sur = Graphics3D[{Transparent,Polygon[{{0, 0, 0}, {w, 0, 0}, {w, l, 0}, {0, l, 0}}]}, 
         Lighting -> {LightBlue}, Boxed -> False];
top = Graphics3D[{Transparent,Polygon[{{0, 0, h}, {w, 0, h}, {w, l, h}, {0, l, h}}]},
        Lighting -> {LightBlue}, Boxed -> False];
Show[{f, b, s1, s2, sur, top}]

I tried to set Lighting options for the 3D objects. However that does not seem to work. Can anyone help me?

One another option that I was thinking of was to have something similar to a heat map.

  • $\begingroup$ Do you mean rectangle or cuboid? $\endgroup$ – cormullion Feb 25 '13 at 14:00
  • $\begingroup$ Actually,I want to build a building,but that code was big,so for sampling Rectangle was fine... $\endgroup$ – subbu Feb 25 '13 at 14:03

Perhaps easier:

Graphics3D[{Opacity[.3], Cuboid[{0,0,0}, {100,200,30}]}, Lighting -> {LightBlue}, Boxed -> False]

Mathematica graphics

  • 1
    $\begingroup$ In his case: Graphics3D[{Opacity[0.3], Cuboid[{0, 0, 0}, {w, l, h}]}, Lighting -> {LightBlue}, Boxed -> False] $\endgroup$ – Öskå Feb 25 '13 at 12:35
  • $\begingroup$ @Öskå Feel free to edit the answer. I just stole the example from the help, of course $\endgroup$ – Dr. belisarius Feb 25 '13 at 12:37
  • $\begingroup$ @Öskå see this meta.mathematica.stackexchange.com/a/32/193 $\endgroup$ – Dr. belisarius Feb 25 '13 at 12:53
  • $\begingroup$ "Thank you for this answer, but it doesn't answer my question because in my application I want the bottom to be transparent, top to have the full lena picture and the sides to start from transparent at the bottom and end opaque at the top with toad watermarks in the center." Waaaaah :'( $\endgroup$ – rm -rf Feb 25 '13 at 13:45
  • $\begingroup$ @rm-rf And cheddar cheese as topping $\endgroup$ – Dr. belisarius Feb 25 '13 at 13:55

You're looking for Opacity



And searching Transparent in the documentation you will find Add Transparency To Plots


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.