Skip to main content
gamedev.net
🔒 Locked

.md2 model texturing

Started by Rocket05 Jan 17, 2003 at 4:51 PM 0 replies 350+ views
Original Post
Rocket05
Rocket05
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:
    
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);
		}
	}
     
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]
"I never let schooling interfere with my education" - Mark Twain
Raduprv
Raduprv
A few months ago I wrote an MD2 loader, which works just fine, didn''t have too many problems with it.
Try to turn the texture upside down, sometimes it is inversed, sometimes it isn''t.
Can you post some other screenshots, with different models?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.