as far as i know, texture coordinates should range [0,1] but in this obj file as follow, the texture coordinates seem to 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 the texture ordinates here can be greater than 1 ? Can anybody explain it to me? Thanks!
you see the texture seems weird
As such, OBJs can encode the surface geometry of a 3D model but can also store color and texture information. The format does not store any scene information (such as light position) or animations, however.
Computing Appropriate Texture Coordinates The texture coordinates of the texture square are (0, 0), (1, 0), (1, 1), and (0, 1) in counterclockwise order. When you're drawing the wall, just give those four coordinate sets as the texture coordinates as you specify the wall's vertices in counterclockwise order.
Texture coordinates define how an image (or portion of an image) gets mapped to a geometry. A texture coordinate is associated with each vertex on the geometry, and it indicates what point within the texture image should be mapped to that vertex.
Unwrapping is the process of assigning texture coordinates to the faces of a mesh. A texture coordinate is a 2 point value, typically called a UV Value, that indicates the position of a particular face's vertex on a texture.
UV texture values outside [0,1] are expected to be tiled.
I've never seen this explicity stated in any of the informal OBJ specs floating about, but it mimics the behavior of OpenGL.
Here is a relevant quote from the OpenGL redbook:
You can assign texture coordinates outside the range [0,1] and have them either clamp or repeat in the texture map. With repeating textures, if you have a large plane with texture coordinates running from 0.0 to 10.0 in both directions, for example, you'll get 100 copies of the texture tiled together on the screen. During repeating, the integer part of texture coordinates is ignored, and copies of the texture map tile the surface. For most applications where the texture is to be repeated, the texels at the top of the texture should match those at the bottom, and similarly for the left and right edges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With