I'd like to add texture to a Cylinder
inside Graphics3D
. I can't see how to use FaceForm
and tell it to use Texture
. The problem is Texture
needs TextureCoordinateFunction
.
I saw few solutions, but many use ParametricPlot3D
, which I could use, but I need a solid Cylinder
, so I would have to do the top/bottom faces manually. For example, using the solution in Applying an ArrayPlot as a texture to the surface of a cylinder I could do
mplt = MatrixPlot[Table[Sin[x y/100], {x, -10, 10}, {y, -10, 10}],
ColorFunction -> "Rainbow", Frame -> False, ImagePadding -> 0,
PlotRangePadding -> 0];
p = ParametricPlot3D[{ Cos[theta], Sin[theta], rho}, {theta, -Pi, Pi}, {rho, 0, 3},
PlotStyle -> Directive[Specularity[White, 30], Texture[mplt]],
TextureCoordinateFunction -> ({#1, #3} &), Lighting -> "Neutral",
Mesh -> None, PlotRange -> All, TextureCoordinateScaling -> True];
Graphics3D[First@p]
But what I want is to add texture to outside surface of
Graphics3D[Cylinder[{{0, 0, 0}, {0, 0, 3}}, 1], Axes -> True]
There is solution here for 2D objects How to texturize a Disk/Circle/Rectangle? since one can find the VertexTextureCoordinates
are easy to do for these.
I think what is needed here is to tell FaceForm
to use Texture
? but do not know how to go about this. Version 9.01
Graphics3D[{First@p, Cylinder[{{0, 0, 0}, {0, 0, 3}}, .99]}, Axes -> True]
$\endgroup$