Mapping Wavefront.obj texture vertices on OpenGL

The artist gave me all the 3D models for export to .obj and .mtl so that I can visualize it using OpenGL.

But I can’t understand why the vertex of the texture is greater than 1, and sometimes negative. Take a look at this example:

(...)
vn -0.000717425 0.00106739 -0.00991695
vn 3.49779e-09 -5.22866e-09 -0.01
vn -0.00142294 0.00211706 -0.00966919
vn -0.00831486 -0.00555545 0
vt 5.82424 -20.091
vt 6.97527 -20.1873
vt 5.81848 -20.1618
vt -7.48189 8.29159
(...)

He sent me all the TGA textures that I load correctly, but I cannot match these vtwith the correct OpenGL texture vector.

+4
source share
1 answer

But I can’t understand why the vertex of the texture is greater than 1, and sometimes negative.

Out of range texture coordinates [0..1]indicate texture repetition.

1D ABCD:

   -1    0    1    2
....|ABCD|ABCD|ABCD|....

, GL_TEXTURE_WRAP_S GL_TEXTURE_WRAP_T GL_REPEAT.

+4

Source: https://habr.com/ru/post/1532208/


All Articles