1
$\begingroup$

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"]

Mathematica graphics

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.

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

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}];

RadioButtonBar[Dynamic[zview],{-1,-.5,-.2,-.1,0,.1,.2,.5,1,2}] //Labeled[#,"ViewPoint altitude"]&

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  

enter image description here

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

$\endgroup$
  • $\begingroup$ The idea of the floating polyhedron is not mine, but I don't remember where I have seen this. $\endgroup$ – andre314 Nov 17 '18 at 19:56
1
$\begingroup$
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"]

fig1

$\endgroup$

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.