Jump to content
  • Advertisement

Archived

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

dachande

md3 info (not code based)

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

Hey, I am interested in using the .md3 model format in my application. Can someone give me an explanation of how these models work, and how they are created? I get the impression that they contain 2 or 3 models inside the one file so that different animations can occur on different parts (legs, torso, head). But I might be wrong - I can''t find any info concerning this. How would I (or my modeler) go about creating md3''s in something like Milkshape? how do you differentiate between the different parts of the body etc.. and lastly if you have time it would be nice to know how the tagging system works too... connecting weapons to arms and similar. Thank you for your time, any information would be appreciated, Dachande

Share this post


Link to post
Share on other sites
Advertisement
"Can someone give me an explanation of how these models work, and how they are created?"

Ok well I can''t exactly give you specifics because I dont have any reference material on this computer, however I think I remember the general way they work... Basically, a model is comprised of the head, the torso and the legs. Each of these parts are individually modelled and animated but they share the same texture map. The different parts are linked together using a script which defines what is attached to what.


"I get the impression that they contain 2 or 3 models inside the one file so that different animations can occur on different parts (legs, torso, head). But I might be wrong - I can''t find any info concerning this."

MD3 files do not contain several models inside each file, but MD3 models are animated using a bone system. A ''bone'' is basically a matrix, it is a transform which is applied to the vertices associated with the bone (Stored in the model file) and the bones are stored in a hierarchy so the transform the hand you first transform it by the lower arm which is first transformed by the upper arm etc...


"How would I (or my modeler) go about creating md3''s in something like Milkshape?"

Check Milkshape''s homepage (www.milkshape3d.com) and go to the tutorials section. A few articles about making MD3s on there - though I personally have never checked out the Quake3 specific tutorials, but they should answer a lot of your questions.


"how do you differentiate between the different parts of the body etc.. and lastly if you have time it would be nice to know how the tagging system works too... connecting weapons to arms and similar."

Well, for a start the different parts of the model are stored in seperate .md3 files! :D

Check out Lonerunner''s page (Link on NeHe''s front page) for working source.



-------- E y e .Scream Software --------
----------------------------------------
                                  /-\
    http://www.eyescream.cjb.net | * |
                                  \-/
----------------------------------------

Share this post


Link to post
Share on other sites
quote:
Original post by TheGilb
Ok well I can't exactly give you specifics because I dont have any reference material on this computer, however I think I remember the general way they work... Basically, a model is comprised of the head, the torso and the legs. Each of these parts are individually modelled and animated but they share the same texture map. The different parts are linked together using a script which defines what is attached to what.


The head/torso/legs are each in their own .md3 file. Their skin is defined in a .skin file (not always the same texturemap for each part) which specifies the shader for it. The models have 'tag' polygons, which link them together.

quote:
Original post by TheGilb
MD3 files do not contain several models inside each file, but MD3 models are animated using a bone system. A 'bone' is basically a matrix, it is a transform which is applied to the vertices associated with the bone (Stored in the model file) and the bones are stored in a hierarchy so the transform the hand you first transform it by the lower arm which is first transformed by the upper arm etc...


MD3 files are not skeletal. They dont contain bones, rather they contain hundreds of vertice meshes, 1 for each frame of animation.

Check http://www.hellkrisp.com for source to an md3 viewer

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack

Edited by - Maximus on February 27, 2002 9:35:08 AM

Share this post


Link to post
Share on other sites
Thank you both for your information and links, they have proven very useful:

Can I just get a clarification check on the skeleton bit?

Do .md3''s use a skeletal animation system? I assumed that they would, but feel free to prove me wrong,

Thanks,

Dachande

Share this post


Link to post
Share on other sites
Hi

I''m no expert but I heard that MD3 files contain skeletal information but it was never used in Quake 3.

So both of the above posts are sort of right.

"To err is human, to really mess up requires a computer"

Share this post


Link to post
Share on other sites
Md3 files contain no skeletal information at all. You are probably thinking of how Quake3 supports both Md3 AND Md4 models, Md4 being a skeletal format supported by the engine but not used in any of the games content.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites
The structure information is rather misleading. The numboneframes entry is just the number of animation frames in the file.

Md3 files are just vertice meshes of every frame saved to the file. They arent skeletal. id software added MD4 support to the engine so that the engine did have a skeletal format to use.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites
I feel there is a little confusion on this subject

To expand on the original question:

How do md3 map objects and weapon models work if md3''s have 3 tags and 3 different sections?

thanks,

Dachande

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by dachande
Hey,

I am interested in using the .md3 model format in my application.

Can someone give me an explanation of how these models work, and how they are created?



To figure out the MD3 File Format I downloaded [url="http://www.planetquake.com/aftershock/"]Aftershock[/url] and looked at the structs in md3.c and md3.h. The structs are pretty self explanatory but [url="http://www.planetquake.com/aftershock/"]Aftershock[/url] does not (at the time of writing) support animation, and nor does it appear to cater for tags. However, adding animation support is trivial (see the source to my program, [url="http://www.hellkrisp.com/"]MD3View[/url]). Both programs are licensed under the GPL.

To clear up, MD3s are divided into meshes. Each mesh has its own shader and its own set of vertices. Along with the vertex/tex-coord arrays is an array of unsigned integers which has 3*numtriangles elements. Each uint in this array refers to a particular vertex and texcoord, and a set of three elements of the array refer to a single triangle of the mesh. For some reason this is called an element array

When drawing the model one should loop through the meshes of the model, and for each mesh, loop through the the element array, and from the element array, the program should draw the index for the current vert from the vertex array, eg vertarray[elementarray];. This index should also be used to grab the texture coordinates.



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!