New in Wolfram
Mathematica
8: New and Improved Scientific and Information Visualization
◄
previous
|
next
►
Graphics & Visualization
Apply Textures to Surfaces and Regions
Use textures in visualization functions to shade surfaces and regions.
In[1]:=
X
bunny = ExampleData[{"Geometry3D", "StanfordBunny"}, "VertexData"];
In[2]:=
X
{amboyna, ash, burloak, goldenoak, kingwood, laurel, cherry, vavona} = ExampleData /@ {{"ColorTexture", "Amboyna"}, {"ColorTexture", "Ash"}, {"ColorTexture", "BurlOak"}, {"ColorTexture", "GoldenOak"}, {"ColorTexture", "Kingwood"}, {"ColorTexture", "Laurel"}, {"ColorTexture", "LightCherry"}, {"ColorTexture", "Vavona"}};
In[3]:=
X
region = RegionPlot[Sin[x] Sin[y] > 0.1, {x, -5, 5}, {y, -5, 5}, PlotStyle -> Texture[burloak], FrameTicks -> None, Frame -> False];
In[4]:=
X
spiral = ParametricPlot[{(r t) Cos[t], (r t) Sin[t]}, {t, 0, 3 Pi + Pi/4}, {r, 0, 1}, PlotStyle -> {Opacity[1], Texture[vavona]}, Mesh -> None, Axes -> None, PlotRange -> All, TextureCoordinateFunction -> ({#1, #2} &), FrameTicks -> None, BoundaryStyle -> None, Frame -> False];
In[5]:=
X
plot = Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> {Opacity[1], Texture[cherry]}, Mesh -> None, Axes -> None, PlotRange -> All, TextureCoordinateFunction -> ({#1, #2} &), Lighting -> "Neutral", Boxed -> False];
In[6]:=
X
bunnysurface = ListSurfacePlot3D[bunny, Mesh -> None, MaxPlotPoints -> 35, PlotStyle -> Texture[goldenoak], PlotRange -> All, TextureCoordinateFunction -> ({#1, #2} &), Lighting -> "Neutral", Axes -> False, Boxed -> False];
In[7]:=
X
contour = ContourPlot3D[ x^2 + y^2 == z^2 + 1, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, ContourStyle -> Texture[kingwood], Mesh -> None, Axes -> None, PlotRange -> All, TextureCoordinateFunction -> ({#1, #2} &), Lighting -> "Neutral", Boxed -> False];
In[8]:=
X
sphere = SphericalPlot3D[ 1 + Sin[5 \[Phi]] Sin[10 \[Theta]]/10, {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, Mesh -> None, Axes -> None, PlotRange -> All, Lighting -> "Neutral", TextureCoordinateFunction -> ({#1, #3} &), PlotStyle -> Texture[amboyna], PlotPoints -> 50, Boxed -> False];
In[9]:=
X
bowl = RevolutionPlot3D[Cos[t], {t, 0, 2 Pi}, Mesh -> None, Axes -> None, PlotRange -> All, Lighting -> "Neutral", TextureCoordinateFunction -> ({#1, #2} &), PlotStyle -> Texture[cherry], PlotPoints -> 50, Boxed -> False];
In[10]:=
X
enneper = ParametricPlot3D[{u - u^3/3 + u v^2, -v - u^2 v + v^3/3, u^2 - v^2}, {u, -1.5, 1.5}, {v, -1.5, 1.5}, Mesh -> None, Axes -> None, PlotRange -> All, Lighting -> "Neutral", TextureCoordinateFunction -> ({#1, #3} &), PlotStyle -> Texture[goldenoak], Boxed -> False];
In[11]:=
X
cubish = RegionPlot3D[x y z < 1, {x, -5, 5}, {y, -5, 5}, {z, -5, 5}, Mesh -> None, Axes -> None, PlotRange -> All, Lighting -> "Neutral", TextureCoordinateFunction -> ({#1, #3} &), PlotStyle -> Texture[kingwood], Boxed -> False];
In[12]:=
X
Grid[{{region, plot, enneper}, {bunnysurface, cubish, sphere}, {bowl, contour, spiral}}]
Out[12]=