Jump to content
  • Advertisement
Sign in to follow this  
Jethro_T

3rd Texture Ordinate

This topic is 2612 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

I have a couple .obj models and they all have 3 texture components (x, y, z). The 3rd component is 0 for most of the texture coordinates but there are cases where it isn't 0. What is this 3rd component for? I'm confused because these models have simple 2D textures, how do I make use of this 3rd texture component if I want to render these models in OpenGL?

Edit: I meant to say component instead of ordinate in the title.

Share this post


Link to post
Share on other sites
Advertisement
It would only make sense in the context of a 3d texture.

Where did you get the obj from? Are you sure you understand the data correctly? You can post a snippet if you're not sure.

Share this post


Link to post
Share on other sites

I have a couple .obj models and they all have 3 texture components (x, y, z). The 3rd component is 0 for most of the texture coordinates but there are cases where it isn't 0. What is this 3rd component for? I'm confused because these models have simple 2D textures, how do I make use of this 3rd texture component if I want to render these models in OpenGL?

Edit: I meant to say component instead of ordinate in the title.


Hi,

I think the last component is w. Its part of the OBJ specification as a optional component for texture maps. I googled around a bit for UVW mapping and it seems 3D studio does this. Try googling a bit and maybe you'll find something more useful :)

Share this post


Link to post
Share on other sites

It would only make sense in the context of a 3d texture.

Where did you get the obj from? Are you sure you understand the data correctly? You can post a snippet if you're not sure.


One of them was downloaded as an .obj from TurboSquid, the other was a model I converted to .obj using 3ds max. The file looks like this:


vt 0.136094 0.281774 0.000000
vt 0.103313 0.289616 0.000000
vt 0.090881 0.265833 0.000000
vt 0.076756 0.240022 0.000000
vt 0.055665 0.212022 0.000000
vt 0.149005 0.250841 0.000000
vt 0.115306 0.258860 0.000000
vt 0.141302 0.231796 0.000000
vt 0.100333 0.234260 0.000000
vt 0.137080 0.178400 0.000000
vt 0.878273 0.966856 0.000000
vt 0.854895 0.964916 0.000000
vt 0.173011 0.237796 -0.102299
vt 0.178353 0.247724 -0.083476
vt 0.162599 0.179400 -0.171986
vt 0.171483 0.219780 -0.147359
vt 0.209470 0.205684 -0.257470
vt 0.240594 0.203584 -0.282304
vt 0.241697 0.226816 -0.165235
vt 0.211623 0.229861 -0.142457
vt 0.235638 0.067661 0.129590
vt 0.236090 0.085520 0.209855
vt 0.196802 0.084572 0.191144
vt 0.198858 0.057299 0.120398


I'm even more confused because the w component is negative at times.

Share this post


Link to post
Share on other sites
Hm, I don't have any idea what that could mean. I'd just recommend you try ignoring it and see how far that gets you. Its possible the artist was using it as just a place to store some extra arbitrary attribute for something in a shader, but as a general rule I don't think a 3rd texture coordinate has any specific meaning for sampling a 2D texture.

Share this post


Link to post
Share on other sites

Hm, I don't have any idea what that could mean. I'd just recommend you try ignoring it and see how far that gets you. Its possible the artist was using it as just a place to store some extra arbitrary attribute for something in a shader, but as a general rule I don't think a 3rd texture coordinate has any specific meaning for sampling a 2D texture.


Alright cool, I was planning to ignore it unless someone could point out it's purpose :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!