SuperMD2 v.1
This is an extension of MakeMD2, a small command-line based tool that converts text files to static MD2 (Quake II model) files, and can also convert one frame of an MD2 or MDX (Kingpin model) file to a script file.
COMMENTS
- // Characters located to the right of this symbol are ignored.
- /* Signals the beginning of a long comment. Characters located after this symbol are ignored until a closing marker appears.
- */ Signals the end of a long comment.
SCOPE
It is possible to nest wraps into their own scope for convenience's sake. Modifications made to the matrix (mxOffset, mxScale, mxRotate , ...) are applied to the current scope and will carry over to its children. When returning back to previous scope, the matrix is reverted back to the parent's matrix. For instance, you may create a branch in a scope, and each leaves as its children. Then you can adjust the pitch, yaw and roll of the branch and have all the leaves follow the same transformation. You may also modify each leave's pitch, yaw and roll individually without affecting the parent or siblings.
- { Moves to the next scope. Some instructions can only be used at certain levels.
- } Closes current scope and go back one level. Some instructions can only be used at certain levels.
META INSTRUCTIONS
MetaSkinSize WIDTH HEIGHT
ROOT - Sets the width and height in pixels of the skin. This information is needed, the model won't be generated without it.
MetaSkinFile FILENAME
ROOT - Adds a skin image to the model. Up to 16 skins can be used per model. At least one skin file must be specified.
MetaOutput FILENAME
ROOT - Provides the name of the MD2 file. If omitted, "tris.md2" is used instead.
MetaFrameName NAME
ROOT - Provides the name of the frame used in the MD2 file. SuperMD2 can only make static models, so only one frame name can be provided. If omitted, "default" is used instead.
COORDINATES MANIPULATION
The order in which transformations are made is important (the model will not look the same if you write "mxScale 1 1 2" and then "mxRotate Y 45", or "mxRotate Y 45" followed by "mxScale 1 1 2"). Like OpenGL and most 3D APIs, transformations (mxOffset, mxScale and mxRotate ) are to be written in reverse order.
mxOffset X Y Z
SUBMODEL - Applies an offset to X, Y and Z coordinates of this scope and children.
mxScale X Y Z
SUBMODEL - Multiplies the X, Y and Z coordinates of this scope and child scopes.
mxRotate AXIS ANGLE
SUBMODEL - Sets a rotation around origin (0,0,0) point. AXIS is X, Y or Z, ANGLE is provided in degrees. To change the central rotation point: use mxOffset to center the wrap on origin (0,0,0), execute the rotation, then move the wrap back to its place with mxOffset again.
mxReset
SUBMODEL - Resets matrix transformations to parent's for the remainder of the scope.
mxIdentity
SUBMODEL - Cancels all matrix transformations for the remainder of the scope.
SUB-MODEL
mdlSub NAME
ROOT - Starts defining a sub-model. Next line must be an open curly bracket. The model is finished when all open curly brackets are closed back to ROOT. Only the very last defined sub-model is converted to MD2.
mdlRecall NAME
SUBMODEL - Inserts the specified submodel. Only previously defined submodels can be inserted.
glMethod FAN/STRIP
SUBMODEL - Defines how the following coordinates should be joined into triangles. When this command is invoked, a new wrap is created.
If no instruction is provided, the program assumes a new vertex is created. Vertices are created using X Y Z U V, where X Y and Z are 3D coordinates and U V are texture coordinates for that vertex. Since triangles are only one-faced, it means that the order in which vertices are entered will impact the orientation (winding) of the face. See illustration below. U and V must be provided in pixels. Valid wraps must contain at least one triangle (3 vertices).