g3d icon indicating copy to clipboard operation
g3d copied to clipboard

Rules for texture mapping?

Open gustavostuff opened this issue 1 year ago • 1 comments

I created this cube in Blender and texture mapping seems to be ok there, but it acts wierd once I import it on g3d.

This is how it looks when I use the exported obj file along with that same texture:

another look from inside the cube:

For g3d I modified the texture just to show you the actual mapping done by g3d:

Thanks in advance!

gustavostuff avatar Mar 29 '23 23:03 gustavostuff

I don't know why exactly, but it assumes texture origin to be bottom-left, when it should be intuitively top-left. The g3d.loadObj function supports flipping U and V texture coordinates, in this case you should call g3d.loadObj with the path of the .obj file, false and true to get the correct texture coordinates, and then pass it to g3d.newModel as the first argument. =)

Tekkitslime avatar Sep 10 '23 07:09 Tekkitslime