home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RISC DISC 3
/
RISC_DISC_3.iso
/
resources
/
etexts
/
gems
/
gemsv
/
ch7_6
/
nff.
< prev
next >
Wrap
Text File
|
1995-01-28
|
4KB
|
138 lines
Neutral File Format (NFF)
The NFF is originally described by Eric Haines in the Standard
Procedural Database (SPD). In this note, we describe a modified
version of NFF. The NFF is designed as a minimal scene description
language. The language was designed in order to test various
rendering algorithms. It is meant to describe the geometry and basic
surface characteristics of objects, the placement of lights, and the
viewing frustum for the eye. Some additional information is provided
for esthetic reasons (such as the color of the objects, which is not
strictly necessary for testing the efficiency of rendering
algorithms).
Presently the following entities are supported by the modified NFF:
A simple perspective frustum
A background color description
A positional (vs. directional) light source description
A surface properties description
Triangle descriptions
NFF files contain lines of text. For each entity, the first field defines
its type. The rest of the line and possibly other lines contain further
information about the entity. Entities include:
"v" - viewing vectors and angles
"b" - background color
"l" - positional light location
"f" - object material properties
"pp" - triangular patch primitive
These are explained below.
Viewpoint location
Template:
"v"
"from" Fx Fy Fz
"at" Ax Ay Az
"up" Ux Uy Uz
"angle" angle
"hither" hither
"yon" yon
"resolution" xres yres
Type Specification:
v
from float float float
at float float float
up float float float
angle float
hither float
yon float
resolution integer integer
Description:
From: the eye location in XYZ.
At: a position to be at the center of the image, in XYZ world
coordinates. A.k.a. "lookat".
Up: a vector defining which direction is up, as an XYZ vector.
Angle: in degrees, defined as from the center of top pixel row to
bottom pixel row and left column to right column.
Hither: distance of the hither plane from the eye.
Yon: distance of the yon plane from the eye.
Resolution: in pixels, in x and in y (currently ignored).
Note that no assumptions are made about normalizing the data (e.g. the
from-at distance does not have to be 1). Also, vectors are not
required to be perpendicular to each other.
For all databases, the aspect ratio is 1.0.
A view entity must be defined before any objects are defined.
Background color
Template:
"b" R G B
Type Specification:
b float float float
Description:
Background color is given R,G and B values between 0 and 1.
Positional light
Template:
"l" X Y Z IpR IpG IpB
Type Specification:
l float float float float float float
Description:
A light is defined by its XYZ position. All light entities must be
defined before any objects are defined. Light source position and its
Red, Green and Blue components, in the range 0.0 to 1.0 are specified.
Upto NUM_LIGHT_SOURCES light sources can be specified.
Fill color and shading parameters
Template:
"f" OdR OdG OdB Kd Ka c1 c2
Format:
f float float float float float float float float
Description:
OdR, OdG and OdB specify the object's diffuse color (RGB triple) in the
range 0.0 to 1.0. Kd is the diffuse reflection coefficient, Ka the ambient
reflection coefficient, c1 and c2 are the parameters for the attenuation
function fatt (d) = 1/(1+c1*d+c2*d*d) used for the light source where "d" is
the distance of a point from the light source (See the textbook by Foley,
van Dam, Feiner and Hughes, Chapter 16 or the newer book, Chapter 14).
Usually, 0 <= Kd <= 1 and 0 <= Ka <= 1, and Kd and Ka are independent.
Triangular patch
Template:
"pp" total_vertices
vert1.x vert1.y vert1.z norm1.x norm1.y norm1.z
[etc. for total_vertices vertices]
Format:
pp integer
[float float float float float float] <-- for total_vertices vertices
Description:
All objects are considered one-sided. A patch is defined by a set of
vertices and their normals. With these databases, a patch is defined
to have all points coplanar. A patch has only one side, with the
order of the vertices being counterclockwise as you face the patch
(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. Note that, since only triangular patches are supported
total_vertices shown must always be 3.