# How to show plastic wrap with Mathematica 3D graphics

I can make a nice wave picture with the following function:

Plot3D[1/(Sqrt[x^2 + y^2] + 3)*(Cos[2*(Sqrt[x^2 + y^2] + ArcTan[x, y])]),
{x, -20, 20}, {y, -20, 20}, PlotPoints -> 100, PlotRange -> {{-20, 20}, {-20, 20}, {-3, 3}},
Axes -> None, Boxed -> False, ImageSize -> 500,  ColorFunction -> "DeepSeaColors"]


Now, I want to change the graphics options so that it looks like it's made of transparent but shiny plastic wrap. I tried various Lighting, Specularity, and Opacity options, but nothing seemed to work. Any suggestions would be much appreciated. Thank you.

• Can you post a link to an image that demonstrates the effect you are looking for? – Jason B. Nov 16 '18 at 21:08

I have tried to re-use this approach.

Here is my best and definitive proposition :

zview=1;

region00=Plot3D[1/(Sqrt[x^2 + y^2] + 3)*(Cos[2*(Sqrt[x^2 + y^2] + ArcTan[x, y])]),
{x, -20, 20}, {y, -20, 20}, PlotPoints -> 100, PlotRange -> {{-20, 20}, {-20, 20}, {-3, 3}},
Axes -> None, Boxed -> False, ImageSize -> 500,  ColorFunction -> "DeepSeaColors"] //
DiscretizeGraphics[#,PlotTheme -> "SmoothShading",MeshCellStyle->{(*1-> Black,*) 2-> Directive[Specularity[Yellow,100],Opacity[0.8],Blue]}]&;

region01=PolyhedronData["Dodecahedron";"OctahedronFourCompound";"MathematicaPolyhedron"]  //
DiscretizeGraphics[#,PlotTheme -> "SmoothShading",MeshCellStyle->{(*1-> Black,*) 2-> Directive[Glow[Red],Specularity[White,200](*,White*)]}]& //Scale[#,2]& //Translate[#,{10,0,-.5}]&;

coeff=20;

lightSourcePosition=coeff{0,0.8,0.2};
lightSource=DiscretizeRegion[Ball[lightSourcePosition,coeff 0.02],
MaxCellMeasure->coeff 0.2,MeshCellStyle->{1-> Gray, 2-> Gray,3-> Gray}];

Show[
region01 ,
region00,
lightSource,
Axes-> True,AxesLabel->{"X","Y","Z"},Lighting->
{{"Point",White,lightSourcePosition},{"Point",GrayLevel[0.8],{0,-160.,4.}}},ImageSize-> 800,
ViewCenter->coeff {0.5,0.5,0.5},ViewPoint->coeff { 0.027,-3.14 ,1.2 zview},
ViewVertical->coeff {-0.017,-0.49,14.5}] //Dynamic


As mentionned by @HenrikShumacher in a comment of the linked page, GraphicsComplex may be better (I'm not a specialist at all).

• The idea of the floating polyhedron is not mine, but I don't remember where I have seen this. – andre314 Nov 17 '18 at 19:56
Plot3D[1/(Sqrt[x^2 + y^2] + 3)*(Cos[
2*(Sqrt[x^2 + y^2] + ArcTan[x, y])]), {x, -20, 20}, {y, -20, 20},
PlotPoints -> 100, PlotRange -> {{-20, 20}, {-20, 20}, {-3, 3}},
Axes -> None, Boxed -> False, ImageSize -> 500,
PlotStyle ->
Directive[RGBColor["Aqua"], Specularity[White, 5], Opacity[.8]],
Exclusions -> None, Mesh -> None, Lighting -> "Neutral"]
`