Original Post
having a slight problem texturing my .md2 models when rendering them, i cant seem to find whats wrong with them...
heres what the model should look like:
http://rocket05.tripod.com/files/grhino.jpg
here's what mine looks like:
http://rocket05.tripod.com/files/myrhino.jpg
damnit i guess no one can help if i cant get the pictures up, tripod is a whore and wont let me post them... mod, please delete this post for me
as you can tell, it appears that some of the texturing works, but some of it doesn't. its obviously a problem with texture coordinates, but i cant tell whats wrong since i use the same method of texture coordinate generation in the bottom on as in the top picture. either way, here's my code:
saying that: m_vData is just a linear array of verticies storing all the frames vertices, so it goes; |frame1|frame2|frame3|, etc. faces is of the triangle structure format used in MD2's (short vertexindicies[3];short textureindicies[3]
and texcoords is of the MD2 texcoord form (short u, short v). anybody had this happen before? i know im not posting enough information here, but im not sure what to post.
any help is greatly appreciated.
[edited by - Rocket05 on January 17, 2003 5:53:26 PM]
[edited by - Rocket05 on January 17, 2003 5:57:01 PM]
for(i = 0; i < header.numtriangles; i++)
{
for(j = 0; j < 3; j++)
{
model->m_vData[faces[i].vertexindicies[j]].tex.Set(((float)texcoords[faces[i].textureindicies[j]].u)/(float)header.skinwidth,
((float)texcoords[faces[i].textureindicies[j]].v)/(float)header.skinheight);
}
}