MCPcopy Index your code
hub / github.com/benfry/processing4 / vertexTexture

Method vertexTexture

core/src/processing/core/PGraphics.java:1628–1646  ·  view source on GitHub ↗

Set (U, V) coords for the next vertex in the current shape. This is ugly as its own function, and will (almost?) always be coincident with a call to vertex. As of beta, this was moved to the protected method you see here, and called from an optional param of and overloaded vertex(). The paramet

(float u, float v)

Source from the content-addressed store, hash-verified

1626 * Used by both PGraphics2D (for images) and PGraphics3D.
1627 */
1628 protected void vertexTexture(float u, float v) {
1629 if (textureImage == null) {
1630 throw new RuntimeException("You must first call texture() before " +
1631 "using u and v coordinates with vertex()");
1632 }
1633 if (textureMode == IMAGE) {
1634 u /= textureImage.width;
1635 v /= textureImage.height;
1636 }
1637
1638 textureU = u;
1639 textureV = v;
1640
1641 if (textureU < 0) textureU = 0;
1642 else if (textureU > 1) textureU = 1;
1643
1644 if (textureV < 0) textureV = 0;
1645 else if (textureV > 1) textureV = 1;
1646 }
1647
1648
1649// /** This feature is in testing, do not use or rely upon its implementation */

Callers 1

vertexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected