Texture
詳細
- テクスチャマッピングは,UVマッピングあるいは拡散マッピングとしても知られている.
- Textureは,通常,モデリングで画像を2D多角形あるいは3D曲面に投影するために使われる.
- TextureはGraphicsとGraphics3Dの両方で使える.
- Texture[obj,…]のオブジェクト obj は,画像,グラフィックスあるいは色の配列でよい.
- 次は,テクスチャの色の値を明示的に指定するのに使える形式である.
-
Texture[{c1,c2,…}] 1Dテクスチャの色 Texture[{{c11,c12,…},…}] 2Dテクスチャの色 Texture[{{{c111,c112,…},…},…}] 3Dテクスチャの色 - それぞれの色は,RGBColor[r,g,b]に対応する形式{r,g,b}のリスト,あるいはRGBColor[r,g,b,a]に対応する形式{r,g,b,a}のリストのいずれかでよい.
- Texture[obj]はTexture[Rasterize[obj]]に等しく,通常ノートブックで表示される大きさと解像度に obj をラスタライズする.
- Texture[obj,map]は,プロジェクションマッピング map からの座標を頂点に割り当てることで多角形の面や曲面に適用可能なテクスチャ obj を与える.
- 次は,可能な2D画像からの3Dプロジェクションマッピングである.
-
Automatic 投影法を自動選択する None 投影しない "Box" ボックス投影 "Cubic" 立方体投影 "Cylindrical" 円筒投影 "Front" x–y 平面上の平面投影 "Planar" 平面投影 "Spherical" 球面投影 - VertexTextureCoordinatesを使って,指定されたグラフィックスプリミティブについてのプロジェクションマッピングが指定できる.
- OpacityをTextureと一緒に使ってテクスチャの全体的な不透明性を指定することができる.
- TextureをFaceFormで使って前と後ろの面に異なったテクスチャを与えることができる.
- Textureの色は,Lightingとのインタラクションにおけるディヒューズ色であるとされる.
例題
すべて開く すべて閉じる例 (4)
Graphics[{Texture[[image]], Polygon[{{0, 0}, {1, 0}, {0.5, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {0.5, 1}}]}]ParametricPlot[{(v + u) Cos[u], (v + u) Sin[u]}, {u, 0, 2 Pi}, {v, 0, 5}, PlotStyle -> {Opacity[1], Texture[[image]]}]Graphics3D[{Texture[[image], "Cubic"], Cube[]}]Graphics3D[{Texture[[image]], EdgeForm[], Polygon[«3»]}]スコープ (20)
基本的な用法 (3)
Graphics[{Texture[[image], "Planar"], #}]& /@ {Triangle[], RegularPolygon[5], Disk[]}Graphics3D[{Texture[[image], "Planar"], #}, Lighting -> "Neutral"]& /@ {Tetrahedron[], Icosahedron[], Sphere[]}RegionPlot[Sin[x] Sin[y] > 1 / 10, {x, -3, 6}, {y, -3, 6}, PlotStyle -> Texture[[image]]]Plot3D[Sin[x + y ^ 2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> {Texture[[image]]}, Mesh -> False, Lighting -> "Neutral"]GraphicsComplexにテクスチャを適用する:
coords = CirclePoints[{0, 0}, 2, 20];
vtcoords = CirclePoints[{0.5, 0.5}, 0.5, 20];
Graphics[{Texture[[image]], GraphicsComplex[coords, {Polygon[Range[20], VertexTextureCoordinates -> vtcoords]}]}]指定 (8)
data = Table[{r, 0, 0}, {r, 0, 1, 1 / 100}];Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0}, {0}, {1}, {1}}]}]勾配ColorDataを使った1Dテクスチャ:
data = Table[ColorData["Rainbow", t] /. RGBColor -> List, {t, 0, 1, 1 / 100}];Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0}, {0}, {1}, {1}}]}]Graphics3D[{Texture[data], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> "Neutral"]Plot3Dの曲面上の1Dテクスチャ:
Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> Texture[data], Lighting -> "Neutral"]data = Table[{r, g, 0}, {r, 0, 1, 1 / 100}, {g, 0, 1, 1 / 100}];Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]Graphics3D[{Texture[data], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> "Neutral"]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> Texture[data], Lighting -> "Neutral"]Graphics[{Texture[[image], "Planar"], Polygon[{{0, 0}, {1, 0}, {1 / 2, 1}}]}]Graphics3D[{Texture[[image], "Box"], Cube[]}, Lighting -> "Neutral"]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> Texture[[image]], Mesh -> None, Lighting -> "Neutral"]Graphics[{Texture[[image], "Planar"], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}, Background -> Black]text = Style[" Text ", 300];Graphics[{Texture[text, "Planar"], EdgeForm[Gray], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]Graphics3D[{Texture[text, "Box"], Cube[]}, Lighting -> "Neutral"]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> Texture[text], Mesh -> None, Lighting -> "Neutral"]{t2, t3} = {Graphics[{Blue, Disk[], Red, Rectangle[]}], Graphics3D[{Sphere[], Cuboid[]}]}Table[Graphics[{Texture[t], EdgeForm[Gray], Polygon[{{0, 0}, {1, 0}, {1 / 2, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1 / 2, 1}}]}], {t, {t2, t3}}]Table[Graphics3D[{Texture[t], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> "Neutral"], {t, {t2, t3}}]t = ContourPlot[Cos[2x] + y, {x, 0, 2Pi}, {y, 0, 2Pi}, ColorFunction -> "Rainbow", Frame -> False, PlotRangePadding -> None]Graphics[{Texture[t], EdgeForm[Gray], Polygon[{{0, 0}, {1, 0}, {1 / 2, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1 / 2, 1}}]}]Graphics3D[{Texture[t], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> "Neutral"]Plot3D[Cos[x] + y, {x, 0, 4Pi}, {y, 0, 4Pi}, PlotStyle -> Texture[t], Mesh -> None, Lighting -> "Neutral"]data = Table[{r, g, b}, {r, 0, 1, 1 / 20}, {g, 0, 1, 1 / 20}, {b, 0, 1, 1 / 20}];Graphics3D[{Opacity[1 / 3], Texture[data], EdgeForm[], Polygon[Table[{{0, 0, z}, {1, 0, z}, {1, 1, z}, {0, 1, z}}, {z, 0, 1, 1 / 20}], VertexTextureCoordinates -> Table[{{0, 0, s}, {1, 0, s}, {1, 1, s}, {0, 1, s}}, {s, 0, 1, 1 / 20}]]}, Lighting -> "Neutral"]Graphics3D[{Texture[data], EdgeForm[], Table[With[{pts = RotateRight[#, k]& /@ {{1 / 2, 0, 0}, {1 / 2, 1, 0}, {1 / 2, 1, 1}, {1 / 2, 0, 1}}}, Polygon[pts, VertexTextureCoordinates -> pts]], {k, 3}]}, Lighting -> "Neutral"]座標 (5)
Polygonの各頂点に対応する テクスチャ座標は,VertexTextureCoordinatesで指定することができる:
data = Table[{c, 0, 1 - c}, {c, 0, 1, 1 / 100}];Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0}, {0}, {1}, {1}}]}]{0}と{1}の間の座標を使って1Dテクスチャの一部を指定する:
Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{1 / 3}, {1 / 3}, {2 / 3}, {2 / 3}}]}]{0}と{1}から外れる座標値を使って1Dテクスチャを繰り返す:
Graphics[{Texture[data], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{-1}, {-1}, {2}, {2}}]}]2Dテクスチャ座標は,{0,0}から{1,1}の範囲にあると仮定される:
image = [image];Graphics[{Texture[image], EdgeForm[StandardBrown], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]{0,0}と{1,1}の間の範囲にある座標を使って,2Dテクスチャの一部を指定する:
Graphics[{Texture[image], EdgeForm[StandardBrown], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{1 / 3, 1 / 3}, {2 / 3, 1 / 3}, {2 / 3, 2 / 3}, {1 / 3, 2 / 3}}]}]{0,0}と{1,1}から外れる座標値を使って,2Dテクスチャを繰り返す:
Graphics[{Texture[image], EdgeForm[StandardBrown], Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, VertexTextureCoordinates -> {{0, 0}, {4, 0}, {4, 4}, {0, 4}}]}]3Dテクスチャ座標は,{0,0,0}から{1,1,1}の範囲にあると仮定される:
data = Table[{r, g, b}, {r, 0, 1, 1 / 20}, {g, 0, 1, 1 / 20}, {b, 0, 1, 1 / 20}];Graphics3D[{Texture[data], EdgeForm[], Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 1}, {0, 1, 1}}, VertexTextureCoordinates -> {{0, 0, 0}, {1, 0, 0}, {1, 1, 1}, {0, 1, 1}}] }, Lighting -> "Neutral"]FilledCurve成分はテクスチャ座標のサブリストにマッピングされる:
a = {{-1, 0}, {0, 1}, {1, 0}}; b = {{0, -2 / 3}, {-1, 0}};Graphics[{Texture[[image]],
FilledCurve[{{BezierCurve[2a], Line[2b]}, {BezierCurve[a], Line[b]}},
VertexTextureCoordinates -> {{{0, 1 / 2}, {1 / 2, 1}, {1, 1 / 2}, {1 / 2, 1 / 12}, {0, 1 / 2}}, {{1 / 4, 1 / 2}, {1 / 2, 3 / 4}, {3 / 4, 1 / 2}, {1 / 2, 7 / 24},
{1 / 4, 1 / 2}}}]}]プロット関数のテクスチャ座標は,TextureCoordinateFunctionで指定することができる:
ParametricPlot[{r t Cos[t], r t Sin[t]}, {t, 0, 2Pi}, {r, 0, 1}, PlotRange -> All, Mesh -> False, Axes -> False, PlotStyle -> {Opacity[1], Texture[ExampleData[{"ColorTexture", "Roof"}]]}]ParametricPlot[{r t Cos[t], r t Sin[t]}, {t, 0, 2Pi}, {r, 0, 1}, PlotRange -> All, Mesh -> False, Axes -> False, PlotStyle -> {Opacity[1], Texture[ExampleData[{"ColorTexture", "Roof"}]]}, TextureCoordinateFunction -> ({#1, #2}&)]Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, PlotStyle -> Texture[ExampleData[{"TestImage", "House"}]], TextureCoordinateFunction -> ({#1, #2}&), Lighting -> "Neutral", Mesh -> None]スタイル付け (4)
Opacityを使ってテクスチャの全体的な不透明性を設定する:
Table[Graphics3D[{Opacity[o], Texture[[image]], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> "Neutral", Boxed -> False], {o, {1 / 4, 1 / 2, 2 / 3, 1}}]FaceFormを使って,外側と内側のテクスチャを異なる値に設定する:
vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}};Graphics3D[{FaceForm[Texture[[image]], Texture[[image]]], Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}, Lighting -> "Neutral"]テクスチャを付けられた曲面の鏡面性は,Specularityで設定することができる:
Table[ParametricPlot3D[{Cos[u] (3 + Cos[v]), Sin[u] (3 + Cos[v]), Sin[v]}, {u, 0, 2 π}, {v, 0, 2 π}, TextureCoordinateFunction -> ({2#4, #5}&), PlotStyle -> Directive[Specularity[White, s], Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]]], Axes -> False, Lighting -> "Neutral", Mesh -> None, ImageSize -> Small], {s, {5, 20, 50, 100}}]テクスチャの色は,Lightingとのインタラクションにおけるディヒューズ色であるとされる:
Table[Graphics3D[{Texture[[image]], Polygon[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1},
{0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}},
{{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}},
... }, VertexTextureCoordinates ->
{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}}]}, Lighting -> {{"Point", c, {4, -4, 4}}}, Boxed -> False], {c, {White, Red, Green, Blue}}]一般化と拡張 (1)
形式{r,g,b,a}のリストを使って,テクスチャの個々の画素の透過性を指定する:
data = Table[{1, 0, 0, a}, {u, 0, 1, 1 / 100}, {a, 0, 1, 1 / 100}];vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1, 1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1, 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{0, 0, 1}, {1, 0, 1}, {1, 1, 1}, {0, 1, 1}}};Graphics3D[{Texture[data], Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}, Lighting -> "Neutral", Boxed -> False]data1 = Table[{1, 2 / 3, 0, If[u^2 + v^2 < 1 / 2, 0, 1]}, {u, -1, 1, 1 / 100}, {v, -1, 1, 1 / 100}];
data2 = Table[{0, 0, 1, If[u^2 + v^2 < 1 / 2, 0, 1]}, {u, -1, 1, 1 / 100}, {v, -1, 1, 1 / 100}];Graphics3D[{FaceForm[Texture[data1], Texture[data2]], Polygon[coords, VertexTextureCoordinates -> Table[vtc, {6}]]}, Lighting -> "Neutral", Boxed -> False]アプリケーション (13)
基本的なアプリケーション (1)
mapPolygon[p : Polygon[_, idx_, VertexTextureCoordinates -> vtc_], img_] :=
Block[...]mapPolygon[Polygon[{{0, 0, 0}, {1, 0, 0}, {0.5, 1, 0}}, {1, 2, 3}, VertexTextureCoordinates ->
{{0.2, 0.2}, {0.8, 0.2}, {0.5, 0.8}}], [image]]mapPolygon[Polygon[{{-100, -100, -100}, {100, -100, -100}, {100, 100, -100}, {-100, 100, -100},
{-100, -100, -100}, {100, -100, -100}, {100, -100, 100}, {-100, -100, 100}, {100, -100, -100},
{100, 100, -100}, {100, 100, 100}, {100, -100, 100}, {100, 100 ... 7525, 0.33666666666666667}, {0.9975, 0.33666666666666667}, {0.9975, 0.6633333333333333},
{0.7525, 0.6633333333333333}, {0.2525, 0.6699999999999999}, {0.4975, 0.6699999999999999},
{0.4975, 0.9966666666666666}, {0.2525, 0.9966666666666666}}], [image]]mapPolygon[Polygon[{{0., 0., 1.}, {-0.2777182317483142, 0.20177410616759886, 0.9392336204772784},
{-0.5554364634966285, 0.4035482123351977, 0.7270757700126067},
{-0.7236067977499789, 0.5257311121191336, 0.44721359549995787},
{0.10607892523233588, 0.3 ... 71705951760442, 0.4450936361588238},
{0.6328294048239558, 0.4450936361588237}, {0.3, 0.43993157242460157},
{0.5, 0.43993157242460157}, {0.7, 0.43993157242460157}, {0.9, 0.43993157242460157},
{0.09999999999999998, 0.43993157242460157}}], [image]]環境マップ (3)
env = {Texture[[image], "Spherical"], Black, Sphere[{0, 0, 0}, 100]};Graphics3D[{env, Torus[]}, ViewVector -> {{1, 2, 1}, {0, 0, 0}}, Method -> {"RotationControl" -> "Globe"}]env = {Texture[[image]], Black, EdgeForm[], Polygon[{{-100, -100, -100}, {100, -100, -100}, {100, 100, -100}, {-100, 100, -100},
{-100, -100, -100}, {100, -100, -100}, {100, -100, 100}, {-100, -100, 100}, {100, -100, -100},
{100, 100, -100}, {100, 100, 100}, {100, -100, 100}, {100, 100 ... 7525, 0.33666666666666667}, {0.9975, 0.33666666666666667}, {0.9975, 0.6633333333333333},
{0.7525, 0.6633333333333333}, {0.2525, 0.6699999999999999}, {0.4975, 0.6699999999999999},
{0.4975, 0.9966666666666666}, {0.2525, 0.9966666666666666}}]};Graphics3D[{env, Torus[]}, ViewVector -> {{-1, -2, 1}, {0, 0, 0}}, Method -> {"RotationControl" -> "Globe"}]images = {[image], [image], [image], [image], [image], [image]};
sides = {Polygon[{{-100, -100, -100}, {100, -100, -100}, {100, 100, -100}, {-100, 100, -100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}], Polygon[{{-100, -100, -100}, {100, -100, -100}, {100, -100, 100}, {-100, -100, 100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}], Polygon[{{100, -100, -100}, {100, 100, -100}, {100, 100, 100}, {100, -100, 100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}], Polygon[{{100, 100, -100}, {-100, 100, -100}, {-100, 100, 100}, {100, 100, 100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}], Polygon[{{-100, 100, -100}, {-100, -100, -100}, {-100, -100, 100}, {-100, 100, 100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}], Polygon[{{100, -100, 100}, {100, 100, 100}, {-100, 100, 100}, {-100, -100, 100}},
VertexTextureCoordinates -> {{0.01, 0.01}, {0.99, 0.01}, {0.99, 0.99}, {0.01, 0.99}}]};
env = {Black, EdgeForm[], Riffle[Texture /@ images, sides]};Graphics3D[{env, Torus[]}, ViewVector -> {{-1, -2, 1}, {0, 0, 0}}, Method -> {"RotationControl" -> "Globe"}]天文学 (2)
MaterialShadingでテクスチャマッピングを使って現実的な惑星と衛星を作成する:
celestialMaterial[entity_Entity] :=
Block[{albedo, normals},
albedo = entity["CylindricalEquidistantTexture"];
normals = Image[ResourceFunction[ResourceObject[Association["Name" -> "NormalTexture",
"ShortName" -> "NormalTexture", "UUID" -> "5fc5ea7f-f287-4d4c-b400-df80515487af",
"ResourceType" -> "Function", "Version" -> "1.0.0",
"Description" -> "Generate a no ... ,
"SymbolName" -> "FunctionRepository`$faee06013a97443aa16264966d8cbdba`NormalTexture",
"FunctionLocation" -> CloudObject[
"https://www.wolframcloud.com/obj/f283570d-7972-41db-bf62-7f0a750d8410"]],
ResourceSystemBase -> Automatic]][GeoElevationData["World", GeoRange -> All, GeoModel -> entity, GeoZoomLevel -> 2], 0.1]];
MaterialShading[<|"BaseColor" -> Texture[albedo], "SurfaceNormals" -> Texture[normals], "RoughnessCoefficient" -> 1, "MetallicCoefficient" -> 0|>]
]Graphics3D[{celestialMaterial[#], Sphere[]}, Lighting -> "Accent", Boxed -> False, ViewPoint -> Front]& /@ {Entity["PlanetaryMoon", "Moon"], Entity["Planet", "Mars"], Entity["Planet", "Earth"]}Graphics3D[{{Texture[[image], "Spherical"], Black, Sphere[{0, 0, 0}, 100]}, Texture[Entity["Planet", "Earth"]["CylindricalEquidistantTexture"], "Spherical"], Sphere[{0, 0, 0}]}, ViewVector -> {{2, -2, 0}, {0, 0, 0}}, Method -> {"RotationControl" -> "Globe"}, Lighting -> "Accent", Boxed -> False]地理 (2)
インタラクティブな地球上にGeoGraphicsからの地理データを表示する:
Graphics3D[{Texture[GeoGraphics[GeoBackground -> #, ImageSize -> Large, GeoProjection -> "Equirectangular"], "Spherical"], Black, Sphere[{0, 0, 0}]}, Boxed -> False, ViewPoint -> Front]& /@ {"CountryBorders", "VectorMinimal", "SatelliteWithLabels"}countries = With[{coords = Reverse /@ First[CountryData[#, "Coordinates"]]},
{Texture[#["Flag"]], Polygon[coords, VertexTextureCoordinates -> Transpose[Rescale /@ Transpose[coords]]]}
]& /@ CountryData["SouthAmerica"];
Graphics[{EdgeForm[StandardGray], #}, ImageSize -> Tiny]& /@ countriesShow[%]テクスチャモデル (1)
可視化 (2)
ParametricPlot3D[{1.16 ^ v Cos[v](1 + Cos[u]), -1.16 ^ v Sin[v](1 + Cos[u]), -2 1.16 ^ v(1 + Sin[u])}, {u, 0, 2Pi}, {v, -15, 6}, PlotStyle -> Directive[Specularity[White, 100], Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]]], TextureCoordinateFunction -> ({#4, 3#5}&), Lighting -> "ThreePoint", Mesh -> None, PlotRange -> All, Boxed -> False, Axes -> False]ListSurfacePlot3Dにテクスチャでスタイル付けする:
bunny = MeshCoordinates[ResourceData["Stanford Bunny"]];ListSurfacePlot3D[bunny, MaxPlotPoints -> 35, Mesh -> None, Boxed -> False, Axes -> None, Ticks -> None, TextureCoordinateFunction -> (Normalize[{#1, #2, #3}]&), PlotStyle -> Directive[Specularity[White, 20], Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]]], Lighting -> "Neutral"]テクスチャの例 (1)
ExampleDataには,グレースケールとカラーのテクスチャサンプルが含まれる:
Short[ExampleData["Texture"]]Short[ExampleData["ColorTexture"]]torus[t_] := ParametricPlot3D[{Cos[u] (3 + Cos[v]), Sin[u] (3 + Cos[v]), Sin[v]}, {u, 0, 2 π}, {v, 0, 2 π}, TextureCoordinateFunction -> ({2#4, #5}&), PlotStyle -> Directive[Specularity[White, 50], Texture[ExampleData[{"ColorTexture", t}]]], Axes -> False, Lighting -> "Neutral", Mesh -> None, Boxed -> False, ImageSize -> 120];Table[torus[t], {t, {"Ash", "CheetahFur", "Kingwood", "Metal4", "Vavona", "WhiteMarble"}}]体積のレンダリング (1)
slices = {[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]};data = Developer`ToPackedArray[Map[ImageData, slices]];Manipulate[Graphics3D[{Opacity[Dynamic[o]], Texture[data], EdgeForm[None],
Dynamic[{Polygon[{{x, 0, 0}, {x, 1, 0}, {x, 1, 1}, {x, 0, 1}}, VertexTextureCoordinates -> {{x, 0, 0}, {x, 1, 0}, {x, 1, 1}, {x, 0, 1}}], Polygon[{{0, y, 0}, {1, y, 0}, {1, y, 1}, {0, y, 1}}, VertexTextureCoordinates -> {{0, y, 0}, {1, y, 0}, {1, y, 1}, {0, y, 1}}],
Polygon[{{0, 0, z}, {1, 0, z}, {1, 1, z}, {0, 1, z}}, VertexTextureCoordinates -> {{0, 0, z}, {1, 0, z}, {1, 1, z}, {0, 1, z}}]}]}, Background -> Black, RotationAction -> "Clip"], {{x, 0.5}, 0, 1}, {{y, 0.5}, 0, 1}, {{z, 0.5}, 0, 1}, {{o, 0.75, "opacity"}, 0, 1}]特性と関係 (4)
TextureMappingを使ってオブジェクトごとにプロジェクションマッピングが指定できる:
{Graphics3D[{Texture[[image], "Box"], Cube[]}], Graphics3D[{Texture[[image]], Cube[TextureMapping -> "Box"]}]}"Spherical"マッピングは,曲面上の直交座標の点を極座標に変換する:
ℛ1 = GeodesicPolyhedron[3];
vtc = Table[
{r, θ, ϕ} = ToSphericalCoordinates[c];{Rescale[ϕ - Pi / 2, {-Pi, Pi}], 1 - Rescale[θ, {0, Pi}]}, {c, PolyhedronCoordinates[ℛ1]}];
ℛ2 = Append[ℛ1, VertexTextureCoordinates -> vtc]Graphics3D[{Texture[[image]], EdgeForm[], ℛ2}, Lighting -> "Neutral"]"Cylindrical"マッピングは,曲面上の直交座標の点を円筒座標に変換する:
ℛ1 = BoundaryDiscretizeRegion[Cylinder[]];
vtc = Table[
{ρ, ϕ, z} = CoordinateTransform["Cartesian" -> "Cylindrical", c];{Rescale[ϕ, {-Pi, Pi}], Rescale[z, {-5, 1}]}, {c, MeshCoordinates[ℛ1]}];
ℛ2 = GraphicsComplex[MeshCoordinates[ℛ1], MeshCells[ℛ1, 2], VertexTextureCoordinates -> vtc];Graphics3D[{Texture[[image]], EdgeForm[], ℛ2}, Lighting -> "Neutral"]"Planar"マッピングは,3Dの点を2Dの平面に投影する:
ℛ1 = GeodesicPolyhedron[3];
vtc = Table[c[[1 ;; 2]], {c, PolyhedronCoordinates[ℛ1]}];
ℛ2 = Append[ℛ1, VertexTextureCoordinates -> vtc]Graphics3D[{Texture[[image]], EdgeForm[], ℛ2}, Lighting -> "Neutral"]考えられる問題 (1)
テクスチャマッピングよりもVertexColorsが優先される:
Graphics3D[{Texture[[image]], Polygon[{{-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}},
VertexColors -> {Red, Green, Blue, Purple}]}, Lighting -> "Neutral"]おもしろい例題 (3)
テクスチャのアニメーション (2)
DynamicModule[{}, Graphics3D[{Dynamic[Texture[clock, "Box"], UpdateInterval -> 1], Cube[]}, Lighting -> "Neutral", Boxed -> False], Initialization :> (clock := Module[{hour, min, sec, ht, mt, st}, {hour, min, sec} = Take[DateList[], -3];ht = Pi / 2 - 2 π hour / 12 - (2 π) min / 720;mt = Pi / 2 - 2 π min / 60;st = Pi / 2 - 2 π Floor[sec] / 60;Graphics[{Thick, Arrowheads[Large], Arrow[{{0, 0}, 0.6{Cos[ht], Sin[ht]}}], Arrow[{{0, 0}, 0.9{Cos[mt], Sin[mt]}}], PointSize[Large], Table[Point[0.9{Cos[i], Sin[i]}], {i, 0, 2Pi, π / 6}], Point[{0, 0}], Circle[], Red, Line[{{0, 0}, 0.85{Cos[st], Sin[st]}}]}]])]Graphics[{Dynamic[Texture[frames[[Ceiling[Clock[{1, Length[frames], 1}, 10]]]]], UpdateInterval -> 0.5, Initialization :> (frames = {[image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image], [image]};
quad = Polygon[{{0, 0}, {2, 0}, {2, 2}, {0, 2}}, VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}];)], quad}]DynamicModule[{chickens},
chickens = Table[Translate[quad, pos], {pos, {{5, 6}, {13, 2}, {10, 4}, {6, 1}, {11, 7}, {2, 5}, {3, 2}, {8, 3}, {5, 4}}}];
Graphics[Table[{With[{idx = i}, Dynamic[Texture[frames[[Mod[Ceiling[2 * Clock[100]] + idx * 27, Length[frames], 1]]]], UpdateInterval -> 0.5]], chickens[[i]]}, {i, Length[chickens]}]]
]多面体のテクスチャ (1)
Manipulate[Graphics3D[{Specularity[White, 20], Texture[ImageCrop[ExampleData[{"ColorTexture", "WhiteMarble"}], {128, 128}]], EdgeForm[Opacity[1 / 10]], (Append[#1, {VertexTextureCoordinates -> With[{n = Length[First[#1]]}, Table[1 / 2 {Cos[2 π i / n], Sin[2 π i / n]} + {1 / 2, 1 / 2}, {i, 0, n - 1}]]}]&) /@ Flatten[PolyhedronData[p, "Faces", "Polygon"]]}, Lighting -> "Neutral"], {{p, "RhombicHexecontahedron", "polyhedron"}, PolyhedronData[]}]
| |
| |
関連するガイド
-
▪
- グラフィックス指示子 ▪
- プロットオプション ▪
- 記号的なグラフィックス言語
テキスト
Wolfram Research (2010), Texture, Wolfram言語関数, https://reference.wolfram.com/language/ref/Texture.html (2024年に更新).
CMS
Wolfram Language. 2010. "Texture." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/Texture.html.
APA
Wolfram Language. (2010). Texture. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Texture.html
BibTeX
@misc{reference.wolfram_2026_texture, author="Wolfram Research", title="{Texture}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/Texture.html}", note=[Accessed: 18-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_texture, organization={Wolfram Research}, title={Texture}, year={2024}, url={https://reference.wolfram.com/language/ref/Texture.html}, note=[Accessed: 18-November-2026]}