bmcclint
08-15-2001, 08:59 AM
Well this will seem like another really generic question but I can't seem to find the answer either way...
I have texture mapping working all and well. This is great but I had to convert all the models texture coordinates to a 0.0 - 1.0 float to get the texture applied.
glTexCoord2fv((GLfloat*)&gl_polygon[ipoly].mipvert[ivert]);
glVertex3fv((GLfloat*)&gl_vertex[gl_polygon[ipoly].vert[ivert]]);
I would like to use intereger texture coordinates, is it possible. glTexCoord2sv takes integers but only 0 and 1. OR...I'm doing something really wrong...
EXMAPLE...
Poly 1 has three verts and texture coords on a 256x256 texture.
tv1 = 128,0
tv2 = 0,255
tv3 = 255,255
I had to convert to
tv1 = 0.5,0.0
tv2 = 0.00,1,0
tv3 = 1.0,1.0
A work arond I have is...
glTexCoord2f((float)TexVert[Poly[Polygon].v[Vertex]].s/(float)Texture->x,(float)TexVert[Poly[Polygon].v[Vertex]].t/(float)Texture->y);
Any suggestions...
Thanks...
I have texture mapping working all and well. This is great but I had to convert all the models texture coordinates to a 0.0 - 1.0 float to get the texture applied.
glTexCoord2fv((GLfloat*)&gl_polygon[ipoly].mipvert[ivert]);
glVertex3fv((GLfloat*)&gl_vertex[gl_polygon[ipoly].vert[ivert]]);
I would like to use intereger texture coordinates, is it possible. glTexCoord2sv takes integers but only 0 and 1. OR...I'm doing something really wrong...
EXMAPLE...
Poly 1 has three verts and texture coords on a 256x256 texture.
tv1 = 128,0
tv2 = 0,255
tv3 = 255,255
I had to convert to
tv1 = 0.5,0.0
tv2 = 0.00,1,0
tv3 = 1.0,1.0
A work arond I have is...
glTexCoord2f((float)TexVert[Poly[Polygon].v[Vertex]].s/(float)Texture->x,(float)TexVert[Poly[Polygon].v[Vertex]].t/(float)Texture->y);
Any suggestions...
Thanks...