No texture coords in Surface.java - why?

Hello,

I wonder why Surface.java (the NURBS surface mesh in jME) doesn’t provide UV coordinates for textures? Is it particularly difficult to generate those for a NURBS surface?

Even in the latest master it doesn’t seem to exist, though it is 70 lines longer than the jME 3.0 version. jmonkeyengine/Surface.java at master · jMonkeyEngine/jmonkeyengine · GitHub

Also, trying to find some explanation on which values to put into the factory method as parameters would be nice. There is a very old forum post on this which had some pdf and articles in them, but the Wiki or the comments in the code leave the user guessing what to do. Some examples maybe (e.g. I will contribute a “camping tent” with the game I’m writing for jME community).

Have fun,

Here is a picture of the NURBS-based tent I made:

Looks pretty cool already, but can’t use textures (wanted to make the jME Logo on the outside). Finding the correct values was mostly guessing and a little theory from the pdf technical memo from the other thread.
:chimpanzee_smile:

I suspect applying texture coordinates to arbitrary curved surfaces is non-trivial unless you do the narrowly-useful ‘projected’ approach (x, y = u, v or x, z = u, v, etc).

It’s not fully arbitrary maybe (seems to be always some rectangular topology). The rectangular mapping would cover more than 50 percent of all use cases. Maybe more than 80 percent. Well … I will try to attach a buffer for u,v by scanning the vertex- and index-buffers somehow. It’s not really that urgent though.