Using glTexCoord2f
Need some clarification on this:
For glTexCoord2f(u, v), u and v must be in the range [0,1] right.
So if the texture co-ordinates in my file has something like
...
vt 100 200
vt 2 10
vt 33 100
...
So to use those co-ordinates, I am supposed to divide it by the image_width and image_height right? However I am unable to get the desired result.
Anyone can help?
It depends entirely on what file those tex coords are in. It could be tex coords in pixels, but it may be some other coordinate system. So where is the file from?
Quote: Original post by Monder
It depends entirely on what file those tex coords are in. It could be tex coords in pixels, but it may be some other coordinate system. So where is the file from?
The tex coords is in pixel. The file is used to texture a 3d object that is made up of triangles.
If that is so then then dividing by image_width and image_height to get them in the range [0, 1] should work fine. What looks wrong when you do this?
Quote: Original post by Monder
If that is so then then dividing by image_width and image_height to get them in the range [0, 1] should work fine. What looks wrong when you do this?
It seems that all the triangles sample from a certain portion of the image file though each triangle is supposed to have a different texture area from the input image.
What file format is this? Did you check file format specification for more information?
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement