PRT

Also Known As: Parallel Ray Trace


Type Scene description
Colors NA
Compression Uncompressed
Maximum Image Size NA
Multiple Images Per File NA
Numerical Format NA
Originator Kory Hamzeh
Platform All
Supporting Applications PRT ray trace application, others
See Also NFF, POV, QRT, Radiance

Usage
Description of 3D scenes for ray-tracing or other rendering applications.

Comments
A simple ray tracing format, notable because it is one of the few formats designed to support parallel processing.

Vendor specifications are available for this format.

Code fragments are available for this format.


PRT (Parallel Ray Trace) is the format associated with the PRT ray-tracing application created by Kory Hamzeh. It is apparently based loosely on Eric Haines' Neutral File Format (NFF). Its main distinguishing characteristic is that the PRT application was designed to support parallel rendering, that is, rendering by a number of machines at once, over a network.

Contents:
File Organization
File Details
For Further Information

File Organization

Other than the fact that PRT files consist of a number of ASCII lines, there is little mandatory structure. Lines consist of keywords and parameters.

The following keywords may be found in a PRT file:

from
at
up
angle
resolution
light
background
surface
cone
sphere
hsphere
polygon
ring
quadric
instance
end_instance
instance_of

Each file must start with the following:

from %g %g %g
at %g %g %g
up %g %g %g
angle %g
resolution %d %d

The parameters are listed below:

from Eye location in XYZ world coordinates
at Center of the image, in XYZ world coordinates
up Vector indicating which direction is up
angle Angle of image in degrees
resolution Resolution in pixels in both the x and y directions

File Details

The following information is extracted from the documentation supplied by Kory Hamzeh, the creator of PRT, and explains the keywords listed above:

Light Sources

A light source is defined as follows:

light X Y Z

Format:

light %g %g %g

This keyword defines the position of the light sources. All light sources must be defined before any objects are defined.

Background Color

A background color is defined as follows:

background R G B y

Format:

background %g %g %g y

The background color is in RGB. The last field is used for color cueing (not yet implemented) and must always be 'y'.

Surface Properties

A surface property is defined as follows:

surface Rr Rg Rb Ks Fr Fg Fb T Ar Ag Ab Dr Dg Db Sr Sg Sb P Ior

Format:

surface %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g %g

Parameters are:

Rr Rg Rb

The reflective color triplet. This value should always be 1 1 1 (unless you want this surface to reflect a different percentage per color component).

Ks

The specular component. This value is the percentage of light that is reflected from this object. A value of 0 means no reflection, and a value of 1 means a perfect reflector (mirror).

Fr Fg Fb

The refractive color triplet. This value should always be 1 1 1 (unless you want this surface to refract a different percentage per color component).

T

Transparency value. The amount of light that can go through this object; a value of 0 means a totally opaque object. A value of 1 means a totally transparent object.

Ar Ag Ab

The ambient color for this object; this means the color of an object if it were fully shadowed. All objects are assigned this color before any shading algorithm is started.

Dr Dg Db

The diffuse color component

Sr Sg Sb

This value is the color of the specular highlights. Usually, it should be 1 1 1.

P

The Phong cosine power for highlights. The higher the number (for example 100), the smaller the highlight.

Ior

Index of refraction

Cylinder or Cone

A cylinder or cone is defined as follows:

cone
base.x base.y base.z base_radius
apex.x apex.y apex.z apex_radius

Format:

cone
%g %g %g %g
%g %g %g %g

Sphere

A sphere is defined as follows:

sphere center.x center.y center.z radius

Format:

sphere %g %g %g %g

Hollow Sphere

A hollow sphere is defined as follows:

sphere center.x center.y center.z radius thickness

Format:

sphere %g %g %g %g %g

Polygon

A polygon is defined as follows:

polygon total_vertices
vert1.x vert1.y vert1.z
[etc. for total_vertices vertices]

A polygon is defined by a set of vertices. With these databases, a polygon is defined to have all points coplanar. A polygon has only one side, with the order of the vertices being counterclockwise as you face the polygon (right-handed coordinate system). The first two edges must form a non-zero convex angle, so that the normal and side visibility can be determined.

Format:

polygon %d
[ %g %g %g ] <- for total_vertices vertices

Ring

A ring is defined as follows:

ring center.x center.y center.z p1.x p1.y p1.z p2.x p2.y p2.z or ir

A ring is a flat coplanar round-shaped object. For a ring object, you must specify the following: center, two points on the surface of the ring, the inner radius, and the outer radius. If the inner radius is non-zero, then the ring has a hole in the middle with the given radius.

Format:

ring %g %g %g %g %g %g %g %g %g %g %g

Quadratic

A quadratic is defined as follows:

quadric center.x center.y center.Z
min.x min.y min.z max.x max.y max.z
a b c d e
f g h i j

You can ray trace any quadratic object by specifying the center, minimum, maximum, and coefficients. This is a very powerful object type. It can do ellipsoids, hyperbolas, and any other quadratic surface.

In the model shown above, the fields "a" through "j" are the coefficients.

Format:

quadric %g %g %g
%g %g %g %g %g %g
%g %g %g %g %g
%g %g %g %g %g

Object Instances

You may define a group of objects (and surface properties) to an instance and assign a name to that instance. When the instance is used, all the objects in that instance are placed relative to the given origin. Note that instances by themselves do not create any objects; the objects are created when the instance is referenced. Instances cannot be nested.

An instance is defined as follows:

instance nameofthisinstance
  [ objects and surface properties ]
end_instance

where nameofthisinstance is a user-assigned name such as, for example, tile_pattern.

An instance is referenced as follows:

instance_of nameofinstance loc.x loc.y loc.z

where nameofinstance is the name assigned to a previously defined object instance, and loc.x, loc.y, loc.z represent the location of this object group.

For Further Information

For further information about the PRT format, see the specification included on the CD-ROM. You can also contact:

Kory Hamzeh / Avatar
6217 Melba Avenue
Woodland Hills, CA 91367
Email: kory@avatar.com


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

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