MZD File Format Specification

Eric Mootz, September 2014

 

Introduction

I. Introduction


    The binary MZD file format is the native format of several Mootzoid plugins (e.g. emPolygonizer, emTopolizer, emReader) and is used for storing polygonal data (i.e. polygon meshes).

    A ".mzd" file consists of a header followed by one or more chunks of data for the vertex positions, the polygonal description and any desired combination of the following data:

  • vertex normal vectors.
  • vertex motion vectors.
  • vertex colors.
  • vertex UVWs.
  • polygon node normal vectors.
  • polygon node colors.
  • polygon node UVWs.

    Each chunk starts with an ID followed by a name, the chunk's size and the data itself. The chunk ID and size can be used to quickly move through a file without the need to load the whole data, to skip unknown / unsupported chunk types or to implement some own, custom chunk types.

 

Specifications / Code

II. Specifications / Code


Instead of a detailed file format description only some source code is provided here. Latter is documented, easy to understand and can be used "as is" or reverse engineered.

Should you find a bug or have a comment regarding the code and/or the file format please write to and use "MZD file format description" as the mail's subject.

How to use the provided code:
Download the code, add the ".h" and ".cpp" files to your project and use the function readMZD().
- download code -

An example of how to use the readMZD() function: