User:Nicolas.le-guen/MD3 (file format)

MD3 is a model format supported by the Quake 3 engine. The format can be used for characters, items, and level structure geometry. Animations are saved on a per-vertex basis, opposed to skeletal animation. The format can contain tags (origin and rotation) that games can place models or effects at.

Frame
General properties of a single animation frame.

Tag
An attachment point for another MD3 model.

Surface
An animated triangle mesh.

Encoding
The normal vector uses a spherical coordinate system. Since the normal vector is, by definition, a length of one, only the angles need to be recorded. Each angle is constrained between 0 - 255 to fit in one octet. A normal vector encodes into 16 bits.

(Code in q3tools/common/mathlib.c:NormalToLatLong)

azimuth <- atan2(y, x) * 255 / (2 * pi)

zenith <- acos(z) * 255 / (2 * pi)

Decoding
(Code in q3tools/q3map/misc_model.c:InsertMD3Model)

lat <- zenith * (2 * pi ) / 255

lng <- azimuth * (2 * pi) / 255

x <- cos ( lng ) * sin ( lat )

y <- sin ( lng ) * sin ( lat )

z <- cos ( lat )

Resources

 * Various post at QuakeSrc Forums
 * Quake3 Source
 * Various discussions in IRC chats.
 * MD3 Specification by Phaethon H. (Mirror 1)

Category:CAD file formats Category:3D graphics software Category:Quake (series) Category:Filename extensions