Misfit Code MM3D small logo Misfit Model 3D






SourceForge.net Logo

Get Firefox!

Donate towards my web hosting bill!

Contents

Model Types

An MD3 model contains a set of meshes and tags. Some in-game Quake models are actually composites of several MD3 files. For example, a player model consists of head.md3, upper.md3, and lower.md3 files. Tags within these files tell Quake how to assemble the model files into one single model.

Misfit Model 3D is capable of loading and saving a single MD3 file, or loading and saving all files in a player model as one model.

If you attempt to load a file named head.md3, upper.md3, or lower.md3 and the other two files are present, MM3D will ask you if you want to load all sections as a player model. Answer Yes to load all three files as one model. Answer No to load only the specified model file.

When you save a model, it will be saved as a player model if the following conditions are met. If any of the following conditions are not met, the model will be saved as a single MD3 file.

  • The saving file name is head.md3, upper.md3, or lower.md3
  • The model contains at least three points; one aech named tag_torso, tag_head, and tag_weapon.
  • The model contains at least one group beginning with h_ (for head meshes), u_ (for upper body meshes), and l_ (for lower body meshes).
  • The MD3_composite meta data value is not set to 0 (zero)

If the model is saved as a player model the animation.cfg file will be created automatically. If the model is saved as a single file, no animation.cfg file will be created.

Skin files are read automatically for player and non-player models. Skin files are never created or modified by MM3D. If you wish to change or create a skin file you must do this step manually.

Player Models

A typical MD3 player model might be 60 GL units tall and 15 wide (would be a human size). The base of the feet should be at -24.

Player models consist of three model files: head.md3, upper.md3, and lower.md3. Usually these correspond to head, torso, and legs respectively. These three models are connected with tags (Points in MM3D). The weapon the player is holding is also connected to the player model with a tag.

Typical Tags for player models:

Model File Tags in model
head.md3 tag_head
upper.md3 tag_head, tag_torso, tag_weapon
lower.md3 tag_torso

You can have multiple skins for a player model. Each md3 file should have a corresponding skin file (head_default.skin, lower_default.skin, upper_default.skin). Usually there are at least three skins for a player model: _default.skin, _red.skin, and _blue.skin. For more on skins see Skins and Textures.

Player models need an animation.cfg file to specify which frames correspond to in-game actions. An animation.cfg file might look like the example below. All animation sequences should have at least one frame.

NOTE: It is very important that the animations in your model are in the same order as the Quake MD3 animations listed in the animation example. Animations that are out of order or missing may cause problems with the animation export.

Head models do not have animations, they are joined with the upper body mesh and follow the tag_head point in that mesh. If you want to animate the head, you can have the tag_head way out of bounds in upper.md3 and do all the head animations in the torso (upper) meshes. You should still make a head model because it is used in the HUD).

Example animation.cfg:

//Quake3 player animation file

sex     m

footsteps normal

// first frame, num frames, looping frames, frames per second

0       32      0       25              // BOTH_DEATH1 (twirl death)
32      1       1       25              // BOTH_DEAD1  (end of twirl death)
32      35      0       20              // BOTH_DEATH2 (other side twirl death)
67      1       1       20              // BOTH_DEAD2  (end of other side twirl death)
68      25      0       25              // BOTH_DEATH3 (backflip death)
93      1       1       25              // BOTH_DEAD3  (backflip dead)

94      39      0       15              // TORSO_GESTURE
133     7       0       15              // TORSO_ATTACK   (regular attack shooting)
140     11      0       15              // TORSO_ATTACK2  
151     5       0       15              // TORSO_DROP     (drop weapon)
156     6       0       15              // TORSO_RAISE    (raise weapon)
162     31      0       10              // TORSO_STAND    
193     11      0       10              // TORSO_STAND2

94      12      12      15              // LEGS_WALKCR
107     12      12      15              // LEGS_WALK
120     12      12      17              // LEGS_RUN
133     14      12      17              // LEGS_BACK
148     12      12      14              // LEGS_SWIM
159     6       0       8               // LEGS_JUMP
167     6       0       12              // LEGS_LAND
172     6       0       10              // LEGS_JUMPB
178     6       0       10              // LEGS_LANDB
185     6       6       5               // LEGS_IDLE
192     7       6       5               // LEGS_IDLECR
200     6       6       20              // LEGS_TURN

Weapon Models

A typical MD3 weapon might be 5 GL units wide and 45 long. They usually would have no animations, although it should be possible to add animation by modifying the Quake 3 code. You can also add texture animations with shaders. Weapons have a tag named tag_weapon that attaches to the player model's tag_weapon tag in the upper body mesh.

Tags

Quake 3 uses tags to join models to each other. MM3D loads tags as points, so if you want to create a tag make a Point (more details about points). The point name should be whatever you want the name of the tag to be. The red axis of the tag is forward, the blue axis of the tag is up, and the green axis of the tag is left. For example you want the red side of that tag to face front for tag_weapon.

The MD3 orientation for tags is not the default orientation for MM3D points, so you must rotate any points you create into the correct orientation.

Animations

MD3 animations specify vertex positions for each vertex for each frame of each animation. This can be tedious. When creating a model from scratch it is usually easier to save the model in MM3D format and create skeletal animations. Then when you are ready to export to MD3, convert the skeletal animations to frame animations using the Animation Sets Window and save as an MD3.

Because of the enormous overhead of saving undo information for animations upon insertion and deletion of vertex and face primitives, you are not allowed to add or remove primitives from a model that has frame animations. You may, however, merge another existing model into the one you are working on. This is another reason why it is best to work with MM3D files and skeletal animations and only export MD3 files when necessary.

MM3D will save all frame (vertex, mesh deformation) animations when saving as MD3.

Paths

When an MD3 model is saved, path information is stored in the model. Quake3 uses a VFS (virtual file system), and you must tell Quake3 where your files are located in this VFS. For example a player model might be located in the Quake3 VFS at models/players/man/. So all the models and textures should probably be located in there and when you make a pk3 file (zip file really), it should contain that directory hierarchy.

We still need MM3D to save paths and filenames with models/players/man/. This is where the MD3_PATH metadata attribute comes in. You should set the MD3_PATH metadata attribute to models/players/man/. MD3 Filter will append all filenames that gets stored in the MD3 file to MD3_PATH. So your body.tga texture when saved would be written in the MD3 file as models/players/man/body.tga. When quake3 opens it that is where it will look in the VFS.

Note: The Quake 3 VFS does not start with a /.

Skins and Textures

The MD3 filter can load any image type as a texture if MM3D can use it. When looking for a texture file it ignores the extension and finds any loadable texture with the the right file name (regardless of extension). For example if the model says it should use a file called body.tga, MD3 Filter could use body.png if it exists.

MD3 filter looks for texture images and skin files in the same directory as the model regardless of the values for paths contained in the model.

In general the MD3 filter attempts to load skins in the following manner:

  • First it will look for .skin files with the following pattern. {modelName}_*.skin It will load all images inside those skin files. It will set the material to the image contained in {modelName}_default.skin.
  • If no .skins files are there it will use shaderName specified in the model to look for a texture file.
  • If that does not exist it will look for a valid texture whose filename matches {meshName}.*

When saving MD3 models it sets the shader name to the name of the texture that is assigned to the group. Also note that Quake3 by default only loads TGA and JPG files.

A skin file should be of the form indicated below.

mesh_name,MD3_PATH/textureFilename

and example upper_default.skin:

u_body,models/players/man/default_b.tga
u_cape,models/players/man/default_c.tga

Currently MD3 Filter will not load .shader files. These are files that could do complex OpenGL operations. You can still use shader files with your model inside Quake3 by creating the shader manually. Here is a example:

  • Set group texture to meshName.tga
  • Create a shader file called meshName.shader
  • Quake3 should see meshName.shader and use it because MM3D set it to look for meshName.* and Quake3 should take the shader file first.
  • Check your model in Quake3

MD3 Limits

The MD3 file format has several limits that you should consider when making a model for this format. These are outlined below. If your model has more that the MD3 limit, the file will not be saved correctly and you should get a error message.

  • Only faces and verticies in a group get saved.
  • The MD3_PATH+file name cannot be longer than 63 characters.  (Textures and model names)
  • The group name and point name cannot be longer than 63 characters.
  • Maximum of 1024 animation frames
  • Maximum of 16 Points (Quake 3 Tags)
  • Maximum of 32 Groups
  • Maximum of 256 Textures per Group
  • Maximum of 8192 Triangles per Group
  • Maximum of 4096 Verticies per Group

[ Main | Download | Online Help | Development | Contact ]
Last updated: Sat Aug 1 08:57:02 PDT 2009
Copyright © 2004-2009, Kevin Worcester -- email kevin at the misfitcode.com domain.