OBJ format and texture coordinates

Started by
1 comment, last by floatingwoods 9 years, 11 months ago

Hello,

I have been reading through various documentations of the OBJ (i.e. Wavefront) fileformat, and all mention for the vt tag:


vt u v [w]
Texture coordinates, in (u ,v [,w]) coordinates, these will vary between 0 and 1, w is optional and default to 0.

It says that u and v should have values between 0 and 1, which makes sense.

But many OBJ files contain entries like:


vt -13.7390 -7.9255 0.0000

How should I interpret those? Currently, I am simply doing a fmod so that I finally obtain values between 0 and 1. But that doesn't look correct. Applications like meshlab correctly interpret those values.

Advertisement

Just take them as is. I don't know about the official .obj specification, but in general texture coordinates can certainly be outside 0 and 1 (that's how textures can wrap on an object).

Thanks Phil,

that works indeed! (I forgot to enable the U and V repeat)

This topic is closed to new replies.

Advertisement