Name

textureMode()

Examples
size(100, 100, P3D)
noStroke()
img = loadImage("laDefense.jpg")
textureMode(IMAGE)
beginShape()
texture(img)
vertex(10, 20, 0, 0)
vertex(80, 5, 100, 0)
vertex(95, 90, 100, 100)
vertex(40, 95, 0, 100)
endShape()
size(100, 100, P3D)
noStroke()
img = loadImage("laDefense.jpg")
textureMode(NORMAL)
beginShape()
texture(img)
vertex(10, 20, 0, 0)
vertex(80, 5, 1, 0)
vertex(95, 90, 1, 1)
vertex(40, 95, 0, 1)
endShape()
Description Sets the coordinate space for texture mapping. The default mode is IMAGE, which refers to the actual coordinates of the image. NORMAL refers to a normalized space of values ranging from 0 to 1. This function only works with the P2D and P3D renderers.

With IMAGE, if an image is 100 x 200 pixels, mapping the image onto the entire size of a quad would require the points (0,0) (100, 0) (100,200) (0,200). The same mapping in NORMAL is (0,0) (1,0) (1,1) (0,1).
Related texture()
textureWrap()

Updated on Mon Sep 21 15:53:26 2020.

If you see any errors or have comments, please let us know.