I forgot to mention this the other day, but one more thing about assigning (u,v), especially if you’re loading meshes exported from other programs, is that you don’t have to go through the trouble of creating your own (u,v) texture coordinates like I did previously. They will be present in your obj file. PShape loads .obj, but I can’t seem to find a .getUV() method (perhaps others can chime in about this if they know). You can insread treat the .obj as a regular plain text file and write a simple parser for it. Sample code from wiki link:
# List of texture coordinates, in (u, v [,w]) coordinates, these will vary between 0 and 1, w is optional and defaults to 0.
vt 0.500 1 [0]
vt ...
...