	MD3toMDL
Version: 0.1	
By: Preach (andrew.denner@btinternet.com)

++++++++++++++++++++++++++++
Ok, so here's a handy little tool for people who want to make models for Quake 1, mostly aimed at people who can work in tools like max or maya, but are stuck without an easy way to get their work from these tools into mdl format.

This command line program takes a very simple text file, along with a md3 file and optionally a skin, and outputs a mdl file which should resemble the original md3 model. This tool isn't designed to be the ultimate mdl file creator, it's  probably best used in conjection with a dedicated mdl editor like qme or Willem's upcoming editor to tweak the model to your liking. But hopefully with an md3 file designed carefully enough you will be able to use the output straight away.

	1: The MD3

There are some restrictions on how you create the MD3 for use with this tool. They are mostly so that it is possible to make a model from it that Quake 1 will accept. You should heed the following format limits:

1000 triangles
2000 vertices(old glquake engines will complain if you exceed 1000, but the 	released source code fixes that)
256 frames

You should also construct the entire model from 1 "surface" in the MD3 sense - if your model has multiple components only the first one will be converted. This means the entire model must have a single skin. Note that you are not restricted to the 2 sided unwrapping which the original Quake models used - the tool will preserve any unwrapping an MD3 supports as long as only one skin is used.

	2: The Skin

In order to keep the program low tech and lightweight, the only skin format accepted is an 8bit pcx file. Please make sure it is in the quake palette already, as no colour checking is performed, the palette indexes are just mapped straight out of the file.

	3: The Text File

To use the program, you need to write a short "command file". Make a plain text file, containing the following commands:

md3file <path>
skinfile <path>
mdlfile <path>

where you replace <path> with the path to the MD3 file, the pcx skin and the desired output file. See the included ogre.txt for an example. skinfile and mdlfile are optional, omitting them gives a default 256x256 skin and output file "output.mdl" respectively. More commands should be available in future versions.

	4: The Tool

Run the tool with the command line md3tomdl <textfile>, where <textfile> is replaced by the name of the command file you just wrote. In seconds the model should be written. That's all there is to it, unless you want to look at the source!

Included with the tool and this readme are:
ogre.txt
ogre.md3
ogreblood.pcx

If you place these in the directory with md3tomdl.exe, try runing
md3tomdl ogre.txt 
You should get an ogre.mdl out, although this version of it lacks the pain and death animations.

	5: The Source

The source code is included for people who want to look, tweak, or port the tool to some obscure platform. It's my first proper c++ project, so it's pretty ugly inside.

Hopefully it's written in portable c++, the only thing used outside the standard libraries is boost/cstdint.hpp, which is used for the fixed width integers which are expected in the mdl binary. If you don't want to install boost, you can probably get away with including the C header file of the same name instead, and removing the "using boost::int8_t" lines. I haven't tried though, and would be interested to hear if someone pulls it off.

Since nobody could possibly make a profit off this, the source code is public domain : - ).