Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Do you mean rectangle or cuboid? –  cormullion Feb 25 '13 at 14:00
    
Actually,I want to build a building,but that code was big,so for sampling Rectangle was fine... –  subbu Feb 25 '13 at 14:03

2 Answers 2

Perhaps easier:

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

Mathematica graphics

share|improve this answer
1  
In his case: Graphics3D[{Opacity[0.3], Cuboid[{0, 0, 0}, {w, l, h}]}, Lighting -> {LightBlue}, Boxed -> False] –  Öskå Feb 25 '13 at 12:35
    
@Öskå Feel free to edit the answer. I just stole the example from the help, of course –  belisarius Feb 25 '13 at 12:37
    
@Öskå see this meta.mathematica.stackexchange.com/a/32/193 –  belisarius Feb 25 '13 at 12:53
    
"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 :'( –  rm -rf Feb 25 '13 at 13:45
    
@rm-rf And cheddar cheese as topping –  belisarius Feb 25 '13 at 13:55

You're looking for Opacity

w=100;
l=200;
h=30;
Graphics3D[{Opacity[0.8],
 Polygon[{
  {{0,0,0},{w,0,0},{w,0,h},{0,0,h}},
  {{0,l,0},{w,l,0},{w,l,h},{0,l,h}},
  {{0,0,0},{0,0,h},{0,l,h},{0,l,0}},
  {{w,0,0},{w,0,h},{w,l,h},{w,l,0}},
  {{0,0,0},{w,0,0},{w,l,0},{0,l,0}},
  {{0,0,h},{w,0,h},{w,l,h},{0,l,h}}
 }]},
 Lighting->{LightBlue},Boxed->False]

box

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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