Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Rocket05

.md2 model texturing

This topic is 5726 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!