uvs

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

This page is generated from the comments in src/webgl/p5.Geometry.js . Please feel free to edit it and submit a pull request!

Related References