4
$\begingroup$

I first hoped MaterialShading was suitable for this purpose, but there is not a choice named "Glass" in the included 16 possible materials. And further I found that it conflicts with and will override other effects, like Opacity, Texture, Glow, etc.

$\endgroup$

2 Answers 2

6
$\begingroup$

MaterialShading is more about reflection of light from the surface. Glass implies more refraction, passing of light through. So using simple Opacity and color and Specularity (as David G. Stork did in his answer) should be fine imitating glass. If you want to add some realism, like glass surface scratches, instead of MaterialShading use Texture - it plays well with Opacity, Glow, etc. Note, you can use different textures and it will change how objects below look and feel.

Import some surface image:

texture = Import["https://i.sstatic.net/UJ4xa.jpg"]

enter image description here

Now simply apply it to your graphics primitives:

Graphics3D[{Opacity[.3],Glow[White],Texture[texture,"Box"],#},Boxed->False]&/@
{Cube[],{Sphere[],Cube[]}}

enter image description here

Also, from details section of MaterialShading:

"MaterialShading will override any color, Opacity, Texture, Glow or Specularity settings."

$\endgroup$
1
$\begingroup$
Table[Graphics3D[{Opacity[0.3], Orange, Specularity[White, n], 
   Sphere[]}], {n, {5, 20, 100}}]

enter image description here

$\endgroup$

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.