Sign in to follow this  

OBJ file and texture coordinates

This topic is 474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

 

I have been working on light-weight implementation of custom OBJ file loader :-)

I am attempting to load Sibenik Cathedral from http://graphics.cs.williams.edu/data/meshes.xml to be specific.

I have noticed that some texture coordinates in the OBJ file are negative (that is outside the range [0, 1]), such as

 

vt -0.764533 0.452165 0.000000
vt -0.767727 0.428138 0.000000
vt -0.783781 0.555808 0.000000
vt -0.764533 0.547835 0.000000

 

How do you interpret the negative values here?

 

Thank you!

Share this post


Link to post
Share on other sites

You can leave those as is, provided you have texture coordinates wrapping mode set to GL_REPEAT / D3DTADDRESS_WRAP / D3D11_TEXTURE_ADDRESS_WRAP.

 

It's quite often that designer uses small texture to cover large areas. It doesn't really matter if texture coordinates is above 1.0 or below 0.0, as long as it's not too big to hit devices' limits.

Share this post


Link to post
Share on other sites

Texture space is positive/negative complete space where 0.0 coordinate is top-left/bottom-left pixel center in texture.

 

But of course textures till, and thus texture cooridnate of 1.0,10.0 is ten textures away to right, and 1.0,-10.0 is ten textures left.

 

That is the way by which texture coordiantes can till repeating textures. Interval 0.0-1.0 contains the entire texture.

Share this post


Link to post
Share on other sites

This topic is 474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this