An array that lists the texture coordinates for each of the geometry's vertices.
In order for texture() to work, the geometry needs a way to map the points on its surface to the pixels in a rectangular image that's used as a texture. The geometry's vertex at coordinates (x, y, z)
maps to the texture image's pixel at coordinates (u, v)
.
The myGeometry.uvs
array stores the (u, v)
coordinates for each vertex in the order it was added to the geometry. For example, the first vertex, myGeometry.vertices[0]
, has its (u, v)
coordinates stored at myGeometry.uvs[0]
and myGeometry.uvs[1]
.
Examples
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/p5.Geometry.js and open a pull request!