IRIT2NFF

Section: NFF (-)
Updated: IRIT
Index Return to Main Contents

 6 "IRIT Version 6.0"   

NAME

IRIT2NFF - IRIT To NFF filter

 

Command line options


  irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T] [-g]
                                                                  [-z] DFiles

-l: Linear - forces linear (degree two) surfaces to be approximated by a single polygon along their linear direction. Although, most of the time, linear direction can be exactly represented using a single polygon, even a bilinear surface can have a free-form shape (saddle-like) that is not representable using a single polygon. Note that although this option will better emulate the surface shape, it will create unnecessary polygons in cases where one is enough. -4: Four - Generates four polygons per flat patch. Default is 2. -c: Output files should be filtered by cpp. When set, the usually huge geometry file is separated from the main nff file that contains the surface properties and view parameters. By default all data, including the geometry, are saved into a single file with type extension the same name but a '.geom' extension, which will be included using the preprocessed using cpp before being piped into the nff renderer. -F PolyOpti FineNess: Optimality of polygonal approximation of surfaces. See the variable POLY_APPROX_OPT for the meaning of FineNess. See also -4. -o OutName: Name of output file. By default the name of the first data file from the DFiles list is used. See below on the output files. -g: Generates the geometry file only. See below. -T: Talkative mode. Prints processing information. -z: Prints version number and current defaults.

 

Usage

Irit2Nff converts freeform surfaces into polygons in a format that can be used by an NFF renderer. Usually, one file is created with '.nff' type extension. Since the number of polygons can be extremely large, a '-c' option is provided, which separates the geometry from the surface properties and view specification, but requires preprocessing by cpp. The geometry is isolated in a file with extension '.geom' and included (via '#include') in the main '.nff' file. The latter holds the surface properties for all the geometry as well as the viewing specification. This allows for the changing of shading or the viewing properties while editing small ('.nff') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.nff' file. The '-g' flag can be specified only with '-c'.

In practice, it may be useful to create a low resolution approximation of the model, change viewing/shading parameters in the '.nff' file until a good view and/or surface quality is found, and then run Irit2Nff once more to create a high resolution approximation of the geometry using '-g'.

Example:


 irit2nff -c -l -F 0 8 b58.dat

creates b58.nff and b58.geom with low resolution (FineNess of 5).

Once done with parameter setting, a fine approximation of the model can be created with:


 irit2nff -c -l -g -F 0 64 b58.dat

which will only recreate b58.geom (because of the -g option).

One can overwrite the viewing matrix by appending a new matrix in the end of the command line, created by a display device:


 xgldrvs b58.dat
 irit2nff -l -F 0 32 b58.dat irit.mat

where irit.mat is the viewing matrix created by xgldrvs.

 

Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Nff and can be set within IRIT. See also the ATTRIB IRIT command.

If a certain surface should be finer/caurser than the rest of the scene, one can set a "resolution" attribute which specifies the relative FineNess resolution of this specific surface. Further, "u_resolution" and "v_resolution" might be similarly used to set relative resolution for the u or v direction only.

Example:


 attrib( srf1, "resolution", 2 );

will force srf1 to have twice the default resolution, as set via the '-f' flag.

Almost flat patches are converted to polygons. The rectangle can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the center of the patch. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.

NFF specific properties are controlled via the following attributes: "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.

Example:


 attrib( srf1, "kd", 0.3 );
 attrib( srf1, "shine", 30 );

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise, a color, as set via the IRIT COLOR command, is used if set.

Example:


 attrib( tankBody, "rgb", "244,164,96" );


 

Index

NAME
Command line options
Usage
Advanced Usage

This document was created by man2html, using the manual pages.
Time: 07:28:27 GMT, July 20, 2024