-----------------------------------------------------------------------------
MedDLe v1.4
-----------------------------------------------------------------------------

	by brian martin
	brian@phyast.pitt.edu
	http://www.phyast.pitt.edu/~brian
	also look at http://www.phyast.pitt.edu/~brian/meddle

	Disclaimer: The author takes no responsiblity for misuse of
  this program. He also is not responsible for any damage caused by it.


-----------------------------------------------------------------------------
Quick Start:
-----------------------------------------------------------------------------

edit mdl.cfg to fit your needs
run mdl (i.e. "mdl player.mdl")
hit key '1' for help

what's new??
	some new key's to hit
	better multi skin support
	much better import/export
	pants/shirt color changing
	saves mdl files

-----------------------------------------------------------------------------
Contents:
-----------------------------------------------------------------------------

		1. About MedDLe
		2. Installation
		3. Basic Use
		4. Editing MDL files
		5. History

-----------------------------------------------------------------------------
1. About
-----------------------------------------------------------------------------

MedDLe is a program which lets you look at and edit the mdl
files in quake. These are the files which describe the objects
in quake and are located in the QUAKE\PROGS directory. You have to first
unpack the id1.pak file with a program like unpack or qube. These can both
be found at ftp.cdrom.com.

Features :
		View bitmaps (object textures)
		View/edit point mapping of the vertices
		View/edit polygon mapping
		Export model textures to a BMP file
		Import BMP files to give objects a new 'skin'
		View mdl header information
		3D View of object (vertex/wire frame/flat shaded/texture mapped views)
		Animation frame browser

-----------------------------------------------------------------------------
2. Installation
-----------------------------------------------------------------------------

You should stick MedDLe in its own directory. Just unzip MDLv02.ZIP
in a suitable directory (i.e. c:\mdl).  You should have these files
in the MedDLe directory:

	MDL.EXE         -the executable
	MDL.CFG         -the configuration file
	MDL.FNT         -the fonts
	MDL.PAL         -the palette
	MDL.MAP         -the colormap
	KEY.TXT         -quick reference sheet
	MDLSRC.ZIP      -the source code
	CWSDPMI.EXE     -dpmi environment (not needed if in windows)

If everything is in place, bring up MDL.CFG in a text editor and set
the path variable and video driver to match your system. You can set
the video resolution here too. When your done, save the file. That's it!

note: You may need a 386/483sx and math co-procesor or a 486dx or higher
to run this. I don't know. There are several math emulators on the net
if it doesn't work on your numerically challenged machine.

-----------------------------------------------------------------------------
3. Basic Use
-----------------------------------------------------------------------------

MedDLe has no GUI at this point. Live with it. :)

MedDLe can both be used to view and edit mdl files. To
start the program just type 'mdl file.mdl' where 'file.mdl'
is a valid mdl filename.

You start in 3D mode.

		 ARROW up/down : move eye position up/down
		 ARROW left/right : previous/next animation frame

		 Esc :		exit
		 2 :			goto 2d mode
		 1 :			goto help (about)
		 t :			draw triangles
		 v :			draw vertices
		 s :			TAKE SCREEN SHOT (saved as pic#.bmp)
		 h :			show header
		 c :			auto cycle through animation frames
		 b :			change background color (black, gray, white)
		 r : 			reset view
		 . or > :     next skin
		 , or < :		previous skin
		 " or ' :		next pants color
		 ; or : :		previous pants color
		 } or ] :     next shirt color
		 { or [ :		previous shirt color
		 Tab :        change rendering mode
					(flat shade, gourourd shade, texture, texture + shade)

		 MOUSE up/down + right button : zoom in/out
		 MOUSE move + left button : rotate model
		 MOUSE move : move light source


Just think of the mouse as your hand grabbing the object. It should
then be easy to control. If you hit the '2' key, you will go to
2D mode. Here the keys are:


		 ARROW Keys: 	move cursor

		 Esc :		exit
		 3 :			goto 3d mode
		 1 :			goto help (about)
		 t :			draw triangles
		 v :			draw vertices
		 s :			SAVE MDL FILE
		 p :
		 m :
		 . or > :     next skin
		 , or < :		previous skin
		 " or ' :		next pants color
		 ; or : :		previous pants color
		 } or ] :     next shirt color
		 { or [ :		previous shirt color

		 MOUSE move : move cursor
		 MOUSE left button: grab hi-lighted vertex


The mouse can be used to move vertices in this mode.

Command line options of importance..

		import bmp to skin number # in model.mdl
		(if # is greater than model skins, skin is added)

			mdl -i pic.bmp # model.mdl


		export skin number # to bmp frome model.mdl
		(if # is 0 or  negetive, a new blank skin with triangles is exported)

			mdl -e pic.bmp # model.mdl


NOTE: When you use MedDLe, it will read the original mdl files from
the quake/progs directory but will do all saving and reading from the
current directory. If you load MedDLe in your quake/progs directory,
you may end up erasing something you wish you hadn't. Of course you
can change the read directory in the cfg file, but the save directory
is always the current one.

-----------------------------------------------------------------------------
4. Editing MDL files
-----------------------------------------------------------------------------

The following explains the basic proceedure for replacing object textures.
In this example the 'player.mdl' file is modified with the texture
'play1.bmp'.

	1. First export the original texture. It will be saved in your
	MedDLe directory.
	'mdl -e play0.bmp 1 player.mdl'
	NOTE: If you want to start from stratch, use
	'mdl -e play0.bmp 0 player.mdl'

	2. Now go off and modify the texture in your favorite paint
	program. Make sure you use the original palette of the 'play0.bmp'
	file. Save the modified texture as 'play1.bmp' and place it in your
	MedDLe directory. The file mdl.pal (included) can be loaded into
	programs like Paint Shop Pro so you can use the correct palette.

	3. Import the new texture (play1.bmp).
	'mdl -i play1.bmp 1 player.mdl'
	NOTE: the bmp file must be 8 bit, but meddle is smart enough to
	resize the picture and apply the correct color palette.

	4. Get into 2D mode (hit '2'). You can use the mouse to tweak some
	of the vertices. You want to make sure that you don't change the
	original layout too much, but also want to make sure there is no
	background showing through any of the polygons. You should toggle back
	and forth between 2D mode and 3D mode to check that the texture mapping
	is ok. When your done tweaking, PRESS 's' IN 2D MODE to save your changes.

	Also, you can now change the shirt and pants color to see if you used
	some colors you shouldn't have. Use the " [ ] ; ' " keys to do this.

	NOTE: If you don't press 's' in 2D mode your imported texture
	will NOT be saved!

	5. Copy the new 'player.mdl' file to the quake/progs directory.
	You may want to back up the original 'player.mdl' before doing this.

	6. Run QUAKE!

	Of course the player.mdl is you, so you won't see your changes... :)

Some added features that a serious editor will use are..

	- the file mdl.pal is used for quake. If you are editing a custom game,
		you can replace mdl.pal with your own palette. The colormap can also
		be changed (mdl.map).
	- if you want to add a skin, just make sure the number is greater that
		the current number of skins
	- if you want to extract a blank skin is a number equal to or less
		than zero.

-----------------------------------------------------------------------------
5. History
-----------------------------------------------------------------------------
v1.4
	-fixed import/export- now its rocks
	-shirt/pants color changing
	-multi skins handled better
	-saving enabled
	-some new key mappings
v1.3
	-includes source with public release
	-gouraud shading with colormap
	-new file format support
	-help screens
	-more comments in source and some cleaning
v1.2
	-released with source
	-better mouse control
v1.1
	-not released-gui experiments
	-gouraud shading
v1.0
	-now you can edit the 2d vertices
	-fixed bugs which caused crashes in 3d mode
	-expanded video support via GRX20
	-added flat shading to 3d models and texture mapping
	-you can now cycle through the frames of animation
	-several other little things
v0.1
	-added wire frame 3d view
	-added importing/exporting BMP files
v0.00002
	- same as v0.00001 but with correct palette
v0.00001 (not released, except on IRC)
	- displayed the skin texture

------------------------------------------------------------------------------

Programmers Note: in this version GRX20 was used along with 3DGPL.
I sorta merged the two together and stuck some of my own stuff in there.
The program is not optimized at all, and a sharp eye will notice that
there is no _perspective_ texture mapping. Oh well, maybe I'll get around
to that in a later version. Or maybe not.

Special thanks goes out to...
Chris Babcock for making me aware of the frame data
Raphael Quinet and Sean Werkema for giving out their source which
  made learning to read BMP files easy (also the source taught me a few tricks)
Sergei Savchenko for 3DGPL. I learned a lot of 3D programming from that and
  use several modified versions of his routines for clipping and stuff.
DJGPP v2 and the excellent GRX20 graphics lib.
Id for quake.
Becky for putting up with me :)

-end document------------------------------------------------------------------
