TextureMapping

TextureMapping

is an option for graphics primitives that specifies the texture mapping to use.

Details

  • TextureMapping is also known as UV mapping or diffuse mapping.
  • TextureMapping is typically used in modeling to project an image to a 2D polygon or 3D surface.
  • Possible 3D projection mappings for 2D images include:
  • Automaticautomatically choose the projection
    Noneno projection
    "Box"box projection
    "Cubic"cubic projection
    "Cylindrical"cylindrical projection
    "Front"planar project on the xy plane
    "Planar"planar projection
    "Spherical"spherical projection
    "Stereographic"stereographic projection
  • The projection is separately mapped to each individual primitive specified in the graphic. If a texture is mapped onto a Polygon expression containing multiple polygons, then the texture will be mapped over the entire region covered by the set of polygons. »

Examples

open allclose all

Basic Examples  (3)

Apply texture mapping to a polygon in 2D:

Apply a texture mapping to a cube:

Apply a texture mapping to a sphere:

Scope  (8)

Apply a texture mapping to graphics primitives in 2D:

In 3D:

Apply a "Planar" mapping to project coordinates along a single axis:

Apply a "Cubic" mapping to selectively apply one of three planar mappings based on a point's surface direction:

Apply a "Box" mapping to selectively apply one of six planar mappings based on a point's surface direction:

Apply a "Cylindrical" mapping to use a cylindrical projection for the sides of the primitive and a planar projection for the top and bottom:

Apply a "Spherical" mapping to use a spherical projection:

Apply a "Stereographic" projection to achieve a conformal mapping of the 2D plane to a sphere:

Apply mappings individual to each primitive in a graphic:

Use multi-Polygon to apply a mapping to an entire region covered by polygons:

Applications  (4)

Create a realistic background using a spherical texture:

Apply equirectangular textures to a sphere using the "Spherical" mapping:

Use a "Spherical" mapping to create a star map as the background:

Display geographical data from GeoGraphics on an interactive globe:

Properties & Relations  (2)

VertexTextureCoordinates can be used to explicitly apply texture coordinates to the vertices of some primitives:

TextureCoordinateFunction is used by plots to compute texture coordinates based on certain values at a given point:

Possible Issues  (1)

Primitives with a "Cubic" mapping will show the mapped texture as reversed on three of the size sides:

Use the "Box" mapping to flip the texture based on the sign of the projection axis:

Wolfram Research (2024), TextureMapping, Wolfram Language function, https://reference.wolfram.com/language/ref/TextureMapping.html.

Text

Wolfram Research (2024), TextureMapping, Wolfram Language function, https://reference.wolfram.com/language/ref/TextureMapping.html.

CMS

Wolfram Language. 2024. "TextureMapping." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TextureMapping.html.

APA

Wolfram Language. (2024). TextureMapping. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TextureMapping.html

BibTeX

@misc{reference.wolfram_2024_texturemapping, author="Wolfram Research", title="{TextureMapping}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/TextureMapping.html}", note=[Accessed: 30-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_texturemapping, organization={Wolfram Research}, title={TextureMapping}, year={2024}, url={https://reference.wolfram.com/language/ref/TextureMapping.html}, note=[Accessed: 30-December-2024 ]}