POV

Also Known As: POV-Ray, Persistence of Vision


Type Vector
Colors Unlimited
Compression None
Maximum Image Size Unlimited
Multiple Images Per File Yes
Numerical Format ASCII
Originator POV-Team
Platform MS-DOS, Macintosh, Amiga, UNIX
Supporting Applications POV-Ray
See Also TGA, GIF

Usage
POV is a scene-description language used to mathematically represent image data that is rendered by the POV-Ray ray tracing engine.

Comments
One of the few formats described in this book that is created entirely by the human hand.

Vendor specifications are available for this format.


The POV (Persistence of Vision) format is used to store the scene description language used by the POV-Ray (Persistence of Vision Raytracer) software package. This format is very similar to other vector-based animation and ray tracing formats.

Contents:
File Organization
File Details
For Further Information

POV-Ray is capable of creating photorealistic, 3D images using a graphical rendering technique called ray tracing. Simple shapes, textures, lights, and properties are available to render images. POV-Ray also supports many advanced ray tracing features, such as Bezier patches, blobs, height-fields, and bump and material mapping.

Images are created by a POV-Ray user writing mathematical code in an editor and rendering the image using the ray-tracing engine. POV-Ray then writes out the rendered image to a file using either the TGA (24-bit) or GIF (8-bit) raster file formats.

Because the process of creating a POV-Ray image is similar to the way in which a programmer writes and compiles code (rather than the way in which an artist uses a paint program), POV scene-description files are more akin to source code files than to typical graphics format files.

The information stored in a POV language file is a set of descriptions of the scenes in the rendered image. The POV scene description language may therefore be thought of as a PostScript-like page description language for ray-traced images.

File Organization

POV scene files contain three types of elements: camera, object, and light source. A camera is the angle of the view into the image. Different perspectives of the scene may be rendered by changing the angle of the camera view and the position of the camera within the image. An object is a visible shape that can be seen in the rendering. A light source is an invisible object that illuminates the visible objects in the scene. Each scene may have multiple objects and lights, but only one camera.

Let's look at a minimal POV scene file and examine the elements:

//
// The canonical red ball on a green floor
//
camera {
	location <0 1 -2>
	look_at <0 1 2>
}
object {
	sphere { <0 1 2> 1 }
	texture { color red 1 phong 1 }
}
object {
	plane { <0 1 0> 0 }
	texture { color green 1 }
}
object {
	light_source { <3 3 -3> color red 1 green 1 blue 1 }
}

In this example we see a camera and three objects: a sphere, a plane, and a light source. The camera object contains two statements. The first, location, indicates the position of the camera within the rendering. It is followed by a parameter list containing the values of the X, Y, and Z coordinates of the physical camera location with respect to the origin point at location 0 0 0. In the example, the values 0, 1, -2 indicate that the camera is centered horizontally (X = 0), one unit up (Y = 1), and two units back (Z = -2) from the origin.

The second statement, look_at, specifies the direction the camera is pointing and the point of its focus. These points are also described using 3-dimensional coordinate values. In the example, the values 0, 1, 2 indicate that the camera is looking forward (X = 0), one unit up (Y = 1), and focused at a point two units in front of it (Z = 2).

The first object in the scene is the sphere. Being a visible object, this object contains a shape description and a material description. The shape description is a sphere statement, indicating the position of the sphere in the scene and the size of the radius. In the example, the sphere is located at the coordinates 0, 1, 2 and has a radius of 1 unit. The material description is a texture statement specifying that the sphere is red in color and has a phong highlighting intensity value of 1.

The next object is the plane. The plane statement defines a plane with its surface normal along the Y axis and offset 0 units from the Y axis. The texture statement indicates that the plane is green in color.

The last object is the light source object. The parameters of the light_source statement indicate the position of the (omnidirectional) light source and its color (white).

As you can see, objects and cameras are written using code similar to that used in many computer languages. Each statement begins with a keyword and is followed by a function body with zero or more values or statements enclosed in braces. For example:

sphere { <0 1 0> -4 }
box { <-2 -4 -3.5> <2.5 5.0 2.5> }
color_map { [0.0 0.2 color red 1] [0.2 0.4 color red .5] }
camera { location <0,0,0> look_at <0 1 2> }

In this example, the sphere object has a body containing two values, a vector coordinate parameter list and a floating-point value. The body of the box object contains two parameter lists. The color map body contains a two-element array. The camera object contains two statements, each statement in turn containing a parameter list.

There are many objects supported by the POV scene-description language and they are fully detailed in the POV documentation.

File Details

POV files are normal ASCII text and do not contain a header or any binary information. Text information in a POV file is case-sensitive. Lowercase words are reserved language keywords. Uppercase words are used for naming data constructs. A single character in double quotes is a literal character.

Comments in POV files use with the Standard C comment tokens /* */ or the C++ comment token //. The Standard C tokens may be nested. Data may be inserted into a POV file using the #include declaration, as follows:

#include "filename.inc."

POV include files normally have the extension ".inc" and contain information that is shared between multiple POV renderings.

One nice feature of POV is the ability to pre-define a set of data that is used repeatedly, similar to the type definition (typedef) feature found in the C language.

Predefinition is accomplished using the #declare keyword. In this example, we declare a texture with color parameters values for white:

texture { color red 1 green 1 blue 1 }

We can predefine the color white for visual clarity in meaning and for later reuse in the file:

#declare WHITE = color red 1 green 1 blue 1
texture { color WHITE }

For Further Information

For further information about the POV format, see the specification included on the CD-ROM. Information about the POV-Ray description language can be found in the POV-Ray package itself. Versions of POV-Ray for MS-DOS, UNIX, Apple Macintosh, Commodore Amiga, and other computers are available from CompuServe, America Online, the Internet, and many BBSs.

See these POV-Ray sites:

ftp://alfred.ccs.carleton.ca/
http://www.povray.org/
ftp://ftp.povray.org/

The Waite Group has published an excellent book on ray tracing on the PC using POV-Ray. This book comes with the POV-Ray tracing software for the PC with many scenes and objects and also contains a nice introduction to the art and concepts of ray tracing. See the following:

Wells, Drew and Young, Chris, Ray Tracing Creations: Generate 3D Photo-Realistic Images on the PC, Waite Group Press, Corte Madera, CA. 1993.

If you have questions about POV-Ray, you can contact:

Chris Young
POV-Ray Team Coordinator
Email: 76702.1655@compuserve.com


[Previous] [Next] [Up] [Index]
Contents | Glossary | Main | Formats | Software | Internet | Book

Copyright © 1996, 1994 O'Reilly & Associates, Inc. All Rights Reserved.