MTV File Format Summary

Also Known As: None

Type Scene description
Colors NA
Compression Uncompressed
Maximum Image Size NA
Multiple Images Per File Yes
Numerical Format ASCII
Originator Mark VandeWettering
Platform All
Supporting Applications MTV, various conversion utilities
See Also NFF, PBM

Used by the MTV ray tracer, although numerous conversion utilities, usually associated with other ray tracers, exist.

One of the early ray tracers, still in use because of its easy availability, wide distribution, and simplicity.

Vendor specifications are available for this format.

Code fragments are available for this format.

The MTV formats were created to support Mark VandeWettering's MTV ray tracer and are named for the author. The MTV application has been ported to many platforms and has enjoyed wide distribution, through the newsgroup on the Internet and through the network of private (primarily PC-based) BBSs. Although the author considers both the program and the format to be dead, the format still enjoys a certain degree of currency, mainly due to its understandable design and simplicity. MTV is still being downloaded with some regularity from a number of bulletin boards and information services.

File Organization and Details
For Further Information

File Organization and Details

Both the MTV input format and the output format are based on other formats that are described . The following sections provide summary information only.

Input Format

The MTV input format is identical to the Neutral File Format (NFF) developed by Eric Haines and described in detail in the NFF article.

NFF files consist of lines of ASCII text. Each line describes an object called an entity. The first field of each line describes the entity's type, and subsequent fields on the same line, and possibly subsequent lines, contain further information about the entity. The following entities are currently supported:

  • Simple perspective frustum

  • Background color description

  • Positional (versus directional) light-source description

  • Surface-properties description

  • Polygon, polygonal patch, cylinder/cone, and sphere descriptions

Entities are coded as follows:

``v'' Viewpoint location (viewing vectors and angles)
``b'' Background color
``l'' Positional light location
``f'' Object material properties
``c'' Cone or cylinder primitive
``s'' Sphere primitive
``p'' Polygon primitive
``pp'' Polygonal patch primitive

See the NFF article for a discussion of each entity.

Output Format

The MTV output format is based on the PPM format, a part of the pbmplus package of utilities developed by Jef Poskanzer. PPM is described in the PBM article in this book, and the utilities are included on the CD-ROM. The MTV output format differs only trivially from the PPM format. The author of the MTV format describes the output format as follows:

An MTV format image consists of an ASCII header followed directly by the image data bytes. The ASCII header is merely a string containing the width and height followed by a newline character. The following C statement will print out the ASCII header:

	fprintf(fp, "%d %d\n", width, height) ;

This is followed directly by the image data, which is written out as three unsigned bytes per pixel, originating at the upper left of the image. This is identical to how the bytes are written out in the PPM image format.

If you desire to write PPM format files, you merely need to change the line which outputs the ASCII header to the following:

	fprintf(fp, "P6\n%d %d\n255\n", width, height) ;

Here is an example of a small pixmap in this format:

	# feep.ppm
	4 4
	 0  0  0    0  0  0    0  0  0   15  0 15
	 0  0  0    0 15  7    0  0  0    0  0  0
	 0  0  0    0  0  0    0 15  7    0  0  0
	15  0 15    0  0  0    0  0  0    0  0  0

Programs that read this format should be as lenient as possible, accepting anything that looks remotely like a pixmap.

The PBM article provides additional information about the PPM output format.

For Further Information

For further information about the MTV format, see the specification included on the CD-ROM, as well as the specifications for NFF and PBM.

The MTV ray tracer is no longer being maintained by Mr. VandeWettering, who considers it dead. However, ample documentation is provided with the format package, should the need ever arise. You may also be able to get additional information from:

Mark VandeWettering
1001 West Cutting
Richmond, CA 94804
Voice: 510-236-4000
FAX: 510-236-0388
Email: [email protected]

You can also contact:

Tony Apodaca
Email: [email protected]

This page is taken from the Encyclopedia of Graphics File Formats and is licensed by O'Reilly under the Creative Common/Attribution license.

More Resources