IRIT2Scn

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

 6 "IRIT Version 6.0"   

NAME

IRIT2Scn - IRIT To SCENE (RTrace) filter

SCENE is the format used by the RTrace ray tracer. This filter was donated by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.

 

Command line options


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

-l: Linear - forces linear (degree two) surfaces to be approximated as 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. -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 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

Irit2Scn converts freeform surfaces and polygons into polygons in a format that can be used by RTrace. Two files are created, one with a '.geom' extension and one with '.scn'. Since the number of polygons can be extremely large, the geometry is isolated in the '.geom' file and is included (via '#include') in the main '.scn' file. The latter holds the surface properties for all the geometry as well as viewing and RTrace specific commands. This allows for the changing of the shading or the viewing properties while editing small ('.scn') files.

If '-g' is specified, only the '.geom' file is created, preserving the current '.scn' file.

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

Example:


 irit2scn -l -F 0 8 b58.dat

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

One can ray trace this scene after converting the scn file to a sff file, using scn2sff provided with the RTrace package.

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


 irit2scn -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 the display devices:


 wntdrvs b58.dat
 irit2scn -l -F 0 8 b58.dat irit.mat

where irit.mat is the viewing matrix created by wntdrvs. The output name, by default, is the last input file name, so you might want to provide an explicit name with the -o flag.

 

Advanced Usage

One can specify surface qualities for individual surfaces of a model. Several such attributes are supported by Irit2Scn 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 patch can be converted into two polygons (by subdividing along one of its diagonals) or into four by introducing a new point at the patch center. This behavior is controlled by the '-4' flag, but can be overwritten for individual surfaces bu setting "twoperflat" or "fourperflat".

RTrace specific properties are controlled via the following attributes: "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for their meaning.

Example:


 attrib( srf1, "SCNrefraction", 0.3 );

Surface color is controlled in two levels. If the object has an RGB attribute, it is used. Otherwise a color as set via 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:42 GMT, July 20, 2024