Jump to content
  • Advertisement
Sign in to follow this  
nini

MD3 Tags

This topic is 4102 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

Dear community , i've already posted something similar quite a time... but this is going to make me insane i can't get the different part of MD3 model aligned correctly. In fact i write the parser for use in D3D using a left handed coordinate system. all is loaded correctly but the mulipart mesh is not aligned correctly, here is what i do in pseudo code for the parsing of MD3 Tags :

void CMD3Model::ParseTag(FILE *f,MD3Tag& t)
{
	
		fread(t.Name,64*sizeof(char),1,f);
		fread(t.Pos,3*sizeof(float),1,f);
				
		fread(t.X,3*sizeof(float),1,f);
		fread(t.Y,3*sizeof(float),1,f);
		fread(t.Z,3*sizeof(float),1,f);

		D3DXVec3Normalize(&t.X,&t.X);
		D3DXVec3Normalize(&t.Y,&t.Y);
		D3DXVec3Normalize(&t.Z,&t.Z);



		t.m = D3DXMATRIXA16(    t.X.x,t.Y.x,t.Z.x,0,
				        t.X.y,t.Y.y,t.Z.y,0,
				        t.X.z,t.Y.z,t.Z.z,0,
				        t.Pos.x,t.Pos.y,t.Pos.z,1);


}


then i link the meshes according to tags like so : // This attach the legs with tags that have been parsed in lower.md3 named tag_torso legs->Attach(0,torso); // This attach the head to the tags that have been parsed in upper.md3 named tag_head torso->Attach(0,head); The number is the ID of the link in case a mesh is attached to multiple childs... I know that people start by converting the tag matrix in a quaternion , but for know i want to understand where is the fault in my code or knowledge about this format... Thanks in advance if you can help me ! i've been stucked for this since 1 month...(i made other things of course but this is giving me headache)...

Share this post


Link to post
Share on other sites
Advertisement
None has done a MD3 Viewer with Direct3D ?
Please i really appreciate some help on this...

Share this post


Link to post
Share on other sites
up !
i really need md3 rendering... , i must say that i use D3D with left handed coordinates...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!