Advertisement

Using glTexCoord2f

Started by June 30, 2004 03:56 AM
5 comments, last by Mystery 20 years, 5 months ago
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?
Advertisement
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.
Advertisement
It is BMP file format. Thanks for the help, guys. Realized it was a floating point precision problem.

This topic is closed to new replies.

Advertisement