This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Texture

Texture[obj]
is a graphics directive that specifies that obj should be used as a texture on faces of polygons and other filled graphics objects.
  • Texture[image] can be used to specify a 2D texture based on an image.
  • Textures can be any one-, two-, or three-dimensional arrays of colors.
  • The following forms can be used to explicitly specify the color values for textures:
Texture[{c1,c2,...}]a 1D texture of colors
Texture[{{c11,c12,...},...}]a 2D texture of colors
Texture[{{{c111,c112,...},...},...}]a 3D texture of colors
  • Each color can be either a list of the form corresponding to RGBColor, or a list of the form corresponding to RGBColor.
  • Texture[obj] is equivalent to Texture[Rasterize[obj]] and will rasterize obj at the size and resolution it would normally be displayed in a notebook.
  • Opacity can be used with Texture to specify overall opacity of textures.
  • Texture can be used in FaceForm to texture front and back faces differently.
  • The colors in Texture are taken to be diffuse colors in their interaction with Lighting.
Apply a texture to a polygon in 2D:
Apply a texture to a polygon in 3D:
Apply a texture to several polygons in 3D:
Apply a texture to the surface of ParametricPlot3D:
Apply a texture to a polygon in 2D:
In[1]:=
Click for copyable input
Out[1]=
 
Apply a texture to a polygon in 3D:
In[1]:=
Click for copyable input
Out[1]=
 
Apply a texture to several polygons in 3D:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
 
Apply a texture to the surface of ParametricPlot3D:
In[1]:=
Click for copyable input
Out[1]=
1D texture using a list of RGB colors:
1D texture using a gradient ColorData:
1D texture on a polygon in 3D:
1D texture on the surface of Plot3D:
2D texture using a matrix of RGB colors:
2D texture using an image:
2D texture using stylized text:
2D texture using 2D and 3D graphics:
2D texture using plot functions:
3D texture using an array of RGB colors:
Display the 3D texture by stacking polygons:
Cross sections of the 3D texture:
Texture coordinates corresponding to each vertex of Polygon can be specified by VertexTextureCoordinates:
Specify a portion of 1D texture by using coordinates between and :
Repeat 1D texture by using coordinate values outside of and :
The 2D texture coordinates are assumed to range from to :
Specify a portion of 2D texture by using coordinates within the range of and :
Repeat 2D texture by using coordinate values outside of and :
The 3D texture coordinates are assumed to range from to :
Texture coordinates of plot functions can be specified by TextureCoordinateFunction:
Use Opacity to set overall opacity of textures:
Use FaceForm to set front and back textures differently:
Specularity of a textured surface can be set by Specularity:
The colors in textures are taken to be diffuse colors in their interaction with Lighting:
Use a list of the form to specify transparency of individual pixels of texture:
Use the transparency values to create texture with holes:
ExampleData includes grayscale and color texture samples:
Use the sample textures with a plot function:
Poverty rates around the world:
Map it on the globe:
Use six different images on a box:
By placing the camera inside the box you can see the different views as you rotate:
A view from the outside:
Construct a 3D texture from slices of medical images:
Draw cross sections of the volumetric data:
Texture mapping is preceded by VertexColors:
New in 8