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.
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.
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 it corisponds to head, torso, and legs. 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. This is a bug that will hopefully be addressed soon.
Head models do not have animations, they are joined with the upper and follow the tag_head point. 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
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 where attaches to the player model's tag_weapon tag.
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. The point name should be whatever you want the name of the tag to be. The red axis of the tag is forward and 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.
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.
When a MD3 model is saved, path information is stored in the model. Quake3 uses a virtual file system, and you must tell Quake3 where you files are located in this virtual file system. 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 virtual file system.
Notice: The Quake 3 virtual file system does not start with a /.
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 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:
When saving MD3 models it sets the shader name to the current texture a group is set to. Also of note is that Quake3 by default only loads tgas, and jpgs.
A skin file should be in the formate indicated below.
mesh_name,MD3_PATH/textureFilename
mesh_name,MD3_PATH/textureFilename
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: