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.

Details

  • Texture[] provides a texture that can be applied to faces of polygons and filled curves by setting VertexTextureCoordinates.
  • Texture can be used in both Graphics and Graphics3D.
  • 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 {r,g,b} corresponding to RGBColor[r,g,b], or a list of the form {r,g,b,a} corresponding to RGBColor[r,g,b,a].
  • 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. »

Examples

open allclose all

Basic Examples  (5)

Apply a texture to a polygon in 2D:

Apply a texture to a polygon in 3D:

Apply a texture to a filled curve:

Apply a texture to several polygons in 3D:

Apply a texture to the surface of ParametricPlot3D:

Scope  (17)

Texture Specification  (8)

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:

Use a transparent 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  (5)

Texture coordinates corresponding to each vertex of Polygon can be specified by VertexTextureCoordinates:

Specify a portion of 1D texture by using coordinates between {0} and {1}:

Repeat 1D texture by using coordinate values outside of {0} and {1}:

The 2D texture coordinates are assumed to range from {0,0} to {1,1}:

Specify a portion of 2D texture by using coordinates within the range of {0,0} and {1,1}:

Repeat 2D texture by using coordinate values outside of {0,0} and {1,1}:

The 3D texture coordinates are assumed to range from {0,0,0} to {1,1,1}:

FilledCurve components are mapped to sublists of texture coordinates:

Texture coordinates of plot functions can be specified by TextureCoordinateFunction:

Texture Styling  (4)

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:

Generalizations & Extensions  (1)

Use a list of the form {r,g,b,a} to specify transparency of individual pixels of texture:

Use the transparency values to create texture with holes:

Applications  (8)

Texture Examples  (1)

ExampleData includes grayscale and color texture samples:

Use the sample textures with a plot function:

Earth Texture Map  (1)

Mars Texture Map  (1)

3D Globe Chart  (1)

Poverty rates around the world:

Map it on the globe:

Sky Box  (1)

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:

Dynamic Clock Box  (1)

Marble Bunny  (1)

Volume Rendering  (1)

Construct a 3D texture from slices of medical images:

Draw cross sections of the volumetric data:

Possible Issues  (1)

Texture mapping is preceded by VertexColors:

Neat Examples  (2)

Country Flags  (1)

Textures on Polyhedra  (1)

Wolfram Research (2010), Texture, Wolfram Language function, https://reference.wolfram.com/language/ref/Texture.html (updated 2014).

Text

Wolfram Research (2010), Texture, Wolfram Language function, https://reference.wolfram.com/language/ref/Texture.html (updated 2014).

CMS

Wolfram Language. 2010. "Texture." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. 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_2022_texture, author="Wolfram Research", title="{Texture}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/Texture.html}", note=[Accessed: 28-May-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_texture, organization={Wolfram Research}, title={Texture}, year={2014}, url={https://reference.wolfram.com/language/ref/Texture.html}, note=[Accessed: 28-May-2023 ]}