Problems with texture coordinate in Obj format

as far as I know, the texture coordinates should be [0,1] but in this obj file, as shown below, the texture coordinates are apparently in the range [0,2]

vt 2.0000 2.0000 0.0000 vt 1.7500 2.0000 0.0000 vt 1.7500 1.9750 0.0000 vt 2.0000 1.9750 0.0000 vt 1.7500 1.9500 0.0000 vt 2.0000 1.9500 0.0000 vt 1.7500 1.9250 0.0000 vt 2.0000 1.9250 0.0000 vt 1.7500 1.9000 0.0000 vt 2.0000 1.9000 0.0000 vt 1.5000 2.0000 0.0000 vt 1.5000 1.9750 0.0000 vt 1.5000 1.9500 0.0000 vt 1.5000 1.9250 0.0000 vt 1.5000 1.9000 0.0000 vt 1.2500 2.0000 0.0000 vt 1.2500 1.9750 0.0000 vt 1.2500 1.9500 0.0000 vt 1.2500 1.9250 0.0000 vt 1.2500 1.9000 0.0000 vt 1.0000 2.0000 0.0000 vt 1.0000 1.9750 0.0000 vt 1.0000 1.9500 0.0000 vt 1.0000 1.9250 0.0000 

Why texture coordinates here can be more than 1? Can anyone explain this to me? Thanks!

you see the texture seems weird enter image description here

+4
source share
1 answer

It is assumed that UV texture values ​​outside [0,1] will be tiled.

I have never seen this explication specified in any unofficial OBJ specifications floating around, but it mimics the behavior of OpenGL.

Here is a relevant quote from redbook OpenGL:

You can assign texture coordinates outside the range [0,1] and they either clamp or repeat on the texture map. With the repetition of the texture, if you have a large plane with texture coordinates from 0.0 to 10.0 in both directions, for example, you will get 100 copies of the texture, folded on the screen. During repetition, the integer part of the texture coordinate is ignored, and the copy texture maps the surface tiles. For most applications where the texture should be repeated, the texels at the top of the texture should match those at the bottom, and similarly for the left and right edges.

+5
source

All Articles