SPONSORED LINKS
Bookshelf Contents Previous Next Glossary Index Search

The RTG Utilities and File Format


Introducing the RTG File Format

RTG File Formats

RTG and AnimRTG are portable (ASCII) file formats for 3D models and animation, suitable for game authoring. These formats allow the different game platforms and non-standardized PC development environments to share 3D data.

Although the RTG formats are not standards (governed by a committee), it is designed to be very easy to parse and translate, allowing easy creation of new translators on any platform.

Alias|Wavefront now supplies RTG 2.0, based on the Direct Translator (Dt) API (based on the OpenModel API). RTG 2.0 gives you the following benefits:

Up to version 1.8, Alias|Wavefront RTG and AnimRTG converters were based on the OpenModel API. Alias|Wavefront still supplies this product as a converter for OpenModel.

Changes in RTG 2.0

RTG 1.8 and RTG 2.0 are very similar. Some of the new features are:

Updates

Alias|Wavefront plans to update the RTG applications periodically. All future development of RTG will be based on RTG 2.0. Alias|Wavefront still supplies this product as a converter for OpenModel.

The source code for the Dt API and translators is included in /usr/aw/alias/ODS/Games/source/.

Converting to RTG 2.0

This section describes how to use the interface of the RTG2.0-specific Direct Translator. For information on how to run the translator, see Using the MakeGame Plug-in on page 9 and Using Translators from the Command Line on page 15.

RTG 2.0 Translator

Special Features

Installing

The Direct3D translator does not require any special installation.

Options

When you run the translator from MakeGame, the RTG window appears. Use this window to set the options described below, then click OK to start converting.

File Content Section

Use these options to control what parts of the scene are converted.

Hierarchy Section

Output Pivots w/Hierarchy

Output pivot information for each node in the hierarchy.

Output Transformation

ON -output descriptions of transformations.

OFF - output static geometry in world space.

Output Local Transformation

Output transformation matrix for each node in the hierarchy.

Animation Section

Output Animation

Output animation information. The translator converts the frames specified in the MakeGame window.

Output

For details on the .rtg and .bin file formats see RTG File Format Details on page 108.

Tips & Tricks

Exporting Geometry to RTG 1.8

To convert scenes to RTG 2.0, use the MakeGame and the RTG2.0 Direct Translator. See Installing the MakeGame Plug-in on page 6 and RTG 2.0 Translator on page 98.

Installing

To install the RTG 1.8 converter as an external application in Alias:

  1. In Alias, choose File External Apps. The External Applications window appears.
  2. Open the External Applications section and click Add.

  3. Double-click in the Application Name text box and enter:
    $ALIAS_LOCATION/ODS/Games/bin/rtg %i
    

  4. Open the Application Input section. Turn Write Input ON. In the Input File text box, enter:
    rtg_output_wire.temp
    

  5. Open the Application Output section. Turn Read Output OFF.
  6. Click Go.

    The converter window will open. Click Cancel to close it if you don't want to convert geometry now.

Using the RTG Converter

To convert a scene to a RTG 1.8 format file:

  1. Choose File External Apps. The External Applications window appears.
  2. Click /usr/aw/alias/ODS/Games/bin/rtg %i in the Application Name box.
  3. Open the Application Input section. Choose whether to convert ALL objects or ACTIVE objects from the Input Scope pop-up menu.

    "Active" objects means picked objects and all objects below them in the hierarchy graph.

  4. In the Path for Output text box, enter the path of the output directory.
  5. In the Output File Prefix text box, enter the base name for the output files, to which the converter will add frame numbers and suffixes for different file types (such as ".rtg" and ".bin").
  6. Click Go to launch the converter.

    The Wire to RTG v1.8 window appears.

  7. Set the options described below, then click Save to run the converter.

    A terminal window will display any updates or error messages.

Options

Path for Output

directory where output files are created.

Output File Prefix

the base name for the output files, to which the converter will add frame numbers and suffixes for different file types (such as ".rtg" and ".bin").

Object Level

determines what level of organization in the Alias wire file corresponds to an "object" (which has a vertex list and polygon list) in the RTG file. The Polyset w/Hierarchy option uses object space coordinates. All other options use world space coordinates. Choose from:

All Processed = the entire wire file is treated as one object with one vertex list and one polygon list.

Top Level DAG = each top-level node is treated as an object.

Polyset = each polyset is treated as an object.

Polyset w/Hierarchy = each polyset is treated as an object, and hierarchy information is included. This is the only way to include hierarchy information in an RTG 1.8 file.

Hier.Xform Output

ON = output transformation matrices from the hierarchy.

OFF = output fixed geometry.

Scale Factor

scaling factor for vertex coordinates (use to fit model inside game box).

Scaling is only applied when no hierarchy is being output, since scaling would disrupt transforms applied to vertices in object space.

Geometry Mode

Tris Only = only output triangles. Quadrangles are converted to triangles, other polygons are not output.

Quads Only = only output quadrangles. Triangles are converted to degenerate quadrangles (quadrangle with two points at the same location), other polygons are not output.

Tris & Quads = output triangles and quadrangles. Other polygons are not output.

Tri/Quad Degen = output triangles and quadrangles. Degenerate quadrangles (quadrangle with two points at the same location) are converted to triangles, other polygons are not output.

N-sided = output all polygons. Note that textures on polygons with fewer than 3 or more than 4 sides are not useful.

Vertex Orientation

Clockwise = use clockwise (left-handed) orientation to decide which side of a polygon is the front.

Counter-Clockwise = use counter-clockwise (right-handed) orientation to decide which side of a polygon is the front.

Quad to Tri Strip

output quadrangle vertices in triangle strip format.

Triangle strips can fix problems arising from non-planar quadrangles. This option can be useful to bring geometry into a GL/OpenGL program that uses triangle strips.

This option is not used when the Geometry Mode is Tris Only or N-sided.

Output Vertex Norms

output a list of vertex normals for each object, with indexes for each polygon in the object.

Output Texture Coord

output a list of texture coordinates for each object, with indexes for each polygon in the object.

Output Polygon Norms

output normals for each polygon.

Output Vertex Colors

output a list of vertex colors for each object, with indexes for each polygon in the object.

Vert/VNorm Optimize

do not output redundant vertices or normals.

Generate Textures

output graphics files containing the texture images.

Texture Output

standard format to save texture information in.

Texture Res X

Texture Res Y

default resolution for all textures. Maximum value is 256 in both directions.

Texture Mode

Texture per Shader = output a texture for each shader. A texture is generated for each shader that is assigned to polygons and has a texture or other mapping.

Texture per Polygon = output a texture for each polygon. A texture is generated for each polygon with a shader that has a texture or other mapping. Textures are automatically distorted for irregular quadrangles and triangles.

Color Only = use flat color only (do not output textures).

If Texture per Shader or Texture per Polygon are selected, but a shader does not use textures or mapping (a simple color shader), the translator will output a color value instead of a texture.

Encoded Tex Res

Use Shader Name = encode a texture's resolution information as part of the shader name.

Use Polyset Name = encode a texture's resolution information as part of the polyset name.

NONE = use the default X and Y resolutions (above) for all textures.

See Encoding Texture Resolutions on page 104.

Simple Lighting

modify the colors of objects to simulate a simple light model (parallel light with some ambient).

Show Index Counters

output index counters at the beginning of each list entry. Index counters start at 0 for the first entry of a list and increase with each entry in that list.

Format Precision

number of decimal places to include for numbers. (maximum of 10).

Newline

DOS = use DOS/Windows standard character marker (carriage return + linefeed) for end-of-line.

UNIX = use UNIX standard character marker (linefeed) for end-of-line.

Show Session Params

output the conversion settings (since RTG output is so flexible, it is extremely helpful when decoding to know the settings a file was converted with).

Feedback Level

per Polygon = print a progress message for each polygon during conversion.

per Polyset = print a progress message for each polyset during conversion.

Almost None = do not print progress messages during conversion.

Start Frame

End Frame

start/end frame of animation (output separate files for each frame of animation).

Encoding Texture Resolutions

RTG uses a hack to include the resolution of textures in the file:

To encode a texture resolution in a shader name:

  1. In Alias, open the Multi-lister (Windows Multi-lister Shaders).
  2. Double-click the name box of the Shader icon in the Multi-lister.
  3. Type the following:
    x<xres>y<yres><shadername>
    

    For example, for a shader named GoblinNose, and a texture with resolution 64 by 128, type x64y128goblinNose in the name text box.

To encode a texture resolution in a polyset name:

  1. In Alias, pick all the polysets you want to rename.
  2. Open the Render Stats window (Windows Render stats).
  3. Double-click on the polyset name you want to edit.
  4. Type the following:
    x<xres>y<yres><polysetname>
    

    For example, for a polyset named GoblinNose, and a texture with resolution 64 by 128, type x64y128goblinNose in the name text box.

Output

For details on the .rtg and .bin file formats see RTG File Format Details on page 108.

Tips & Tricks

Exporting Animation to RTG 1.8

To convert scenes to RTG 2.0 (which integrates animation information into the main format), use MakeGame and the RTG2.0 Direct Translator.

See Installing the MakeGame Plug-in on page 6 and RTG 2.0 Translator on page 98.

Using the rtgAnim Utility

The rtgAnim utility and file format were created to supplement the RTG 1.8 format with animation information.

rtgAnim outputs an ASCII representation of the animation for each animated transformation, vertex group, and polyset. The utility outputs the following information:

rtgAnim is in $ALIAS_LOCATION/ODS/Games/bin/. It supports the following command line options:

rtgAnim -i <inputfile> -o <outputfile> [-l] [-s <startframe>] [-e <endframe>] [-b 
<byframe>] [-y] [-z]

:
-i inputfile Valid Alias wire file for input.
-o outputname Base name of the output files, to which rtgAnim appends the frame number or node name for animation files. Note: because rtgAnim can create so many files, it will help if you output the files for each project into separate directories.
-s startframe First frame of animation to convert.
-e endframe Last frame of animation to convert.
-b byframe Number of frames to step between each frame converted. (For example, a step value of 2 means convert every second frame).
-y Use a Y-up world.
-z Use a Z-up world.

Output

Node Files

These files contain the animation data for objects in the scene:

The contents of an rtgAnim node file look like this:

0001.0: X_Rotate 1.58   Y_Rotate 0.928 Z_Rotate 0.972
0003.0: X_Rotate 4.74   Y_Rotate 2.784 Z_Rotate 2.916
0005.0: X_Rotate 7.9    Y_Rotate 4.64   Z_Rotate 4.86
0007.0: X_Rotate 11.06 Y_Rotate 6.496 Z_Rotate 6.804
0009.0: X_Rotate 14.22 Y_Rotate 8.352 Z_Rotate 8.748

This is a sample of frames 1 through 9, by two. Only the rotations were animated in the model, so they are the only transformations output.

For cluster animation, the fields are in world coodinates. For all other types of animation (including keyframed vertices), the coordinates are in object space.

Vertex Files

The contents of an rtgAnim vertex file might like this:

0001.0: X_Translate -0.806515 Y_Translate 0   
0002.0: X_Translate -0.457943 Y_Translate 1 
0003.0: X_Translate -0.10937 Y_Translate 2

This is a sample of frames 1 through 3.

For polysets animated with clusters, the world positions per vertex per frame are output, since it is difficult to work in object space with clusters.

RTG File Format Details

The following describes the Alias|Wavefront Real Time Games Format (v1.0). Running the wire2rtg converter generates an ASCII text .rtg file, and possibly a .bin file (if textures have been assigned to polygonal geometry in PowerAnimator). The .rtg file contains polygonal data with possible hierarchy information and possible texture table data. The .bin file contains a byte oriented RGBA pixel dump of all textures generated for its corresponding .rtg file.

The .rtg file contains various tags including title tags, to denote sections of data, and descriptor tags, which are used for visual reference and can be ignored when parsing the file.

Polygonal Data File (.rtg)

Header Info

The polygonal data (hereafter referred to as P-data) file begins with a number of header lines (currently there are 3 header lines).

These header lines contain general information for the file. So far, only the title, version, and date information header lines are generated.

All header lines begin with tags starting with HEADER_. The following is an example of these lines:

HEADER_TITLE    Alias|Wavefront Real Time Games Output 
HEADER_VERSION v1.0 
HEADER_DATE     Tue Aug 15 21:58:15 1995 (RTG 1.8 only)

Counter Info

Counters for the P-data file appear after the header lines. Currently there is only one counter. This is for the number of objects that exist in the file. All counter info lines will begin with tags starting with NUMBER_OF_. For example:

NUMBER_OF_OBJECTS 4

Flags Info

If there are any flags for the P-data file, they appear after the counter information. These indicate whether or not a particular item(s) will be found in the file.

For example, the flag info line OUTPUT_HIERARCHY on indicates that a hierarchy tree will be found in the file. This version contains flags for:

OUTPUT_VERT_NORMS

Indicates if a NORMAL list for vertex normals is included in this file or not.

OUTPUT_VERT_COLORS

Indicates if a COLOR list for vertex colors is included in the file or not.

OUTPUT_TEX_COORDS

Indicates if a TEXCOORD list for vertex texture coordinates is included in this file or not.

OUTPUT_POLY_NORMS

Indicates if Normals for each polygon will be output on a polygon data line or not.

OUTPUT_HIERARCHY

Indicates if a hierarchy tree is included in this file or not.

OUTPUT_MATERIALS (RTG 2.0 only)

Indicates if materials are included in this file.

OUTPUT_ANIMATION (RTG 2.0 only)

Indicates if animation data is included in this file.

SHOW_INDEX_COUNTERS

Indicates whether or not index counters (sort of like line numbers for each list - starting at 0) are included in this file.

This is an example of a Flags info section:

OUTPUT_VERT_NORMS   on
OUTPUT_VERT_COLORS on
OUTPUT_TEX_COORDS   on
OUTPUT_POLY_NORMS   on
OUTPUT_HIERARCHY    on
SHOW_INDEX_COUNTERS on
OUTPUT_MATERIALS    on
OUTPUT_ANIMATION    on

Selections Info (RTG 1.8 only)

The Selections Info section follows the Flag info section. It contains various modes that had been selected when this file was generated.

Currently there is only one selection line:TEXTURE_MODE. Valid modes (modes that are currently supported) are color, per_shader, or per_polygon.

If color mode is indicated, only RGB color assignments are made to polygons and no textures are generated for this file.

If per_shader is indicated, a texture for each used shader is assigned to polygons, with texture coordinates needed for proper texture mapping.

If per_polygon is indicated, a correctly pre-distorted texture swatch is generated for each polygon, with texture coordinates being pretty much meaningless as these textures effectively map directly to the corners of each polygon.

The Material List (RTG 2.0 only)

The material list contains a list of all materials used in the model. The MATERIAL_LIST line contains a count of the number of materials. Each material is named and has an index which is used in the OBJECTS section to reference the materials. The following is an example:

MATERIAL_LIST 2
    MATERIAL 0
    NAME Shader
    AMBIENT 0.000000 0.585938 0.996094
    DIFFUSE 0.000000 0.468750 0.796875
    SPECULAR 0.000000 0.000000 0.000000
    EMMISION 0.000000 0.000000 0.000000
    SHININESS 0.000000
    TRANSPARENCY 0.000000
    TEXTURE_NAME File#10
    FILENAME color file /usr/u/psantan/user_data/demo/pix/small.rgb

    MATERIAL 1
    NAME DefaultShader
    AMBIENT 0.000000 0.585938 0.996094
    DIFFUSE 0.000000 0.468750 0.796875
    SPECULAR 0.000000 0.000000 0.000000
    EMMISION 0.000000 0.000000 0.000000
    SHININESS 0.000000
    TRANSPARENCY 0.000000
END_MATERIAL_LIST

This is the location in RTG 2.0 that enables you to find texture maps.

The Hierarchy List

A Hierarchy list only exists in the file if the OUTPUT_HIERARCHY flag is set ON. Otherwise, parsing should continue with the OBJECT Data as described in the following.

List Tags

The first line of a hierarchy list begins with the tag HIERARCHY_LIST. There are three tags that follow this on the first line.

The first of these is the Info Level Tag. This tag can be H (Hierarchy only), HX (Hierarchy with Xforms), or HXP (Hierarchy with Xforms and Pivots.

A count for the number of top level dag nodes in the hierarchy list, and a descriptor tag top_level that can be read and ignored follows the Info Level Tag.

After the first line, the hierarchy is output with node lines, and possibly transform lines and pivot lines.

node lines are of the format:

 [level] [node_type] [node_name]

where level is an integer number indicating hierarchy level. A top dag node is at level 0.

The node_type is either G (Group) or P (polygonal) Data.

The node_name is a string name used to individually identify a node.

Using the Hierarchy List

If Hierarchy List is selected, transforms with or without pivots can be output for each node line of the hierarchy. Transform lines are (x,y,z) triplets, one for each of translate, rotate and scale. Pivot lines are (x,y,z) triplets, one for each of scale and rotate.

An example of hierarchy list output without transforms or pivots:

HIERARCHY_LIST H 2 top_level
0 G node#27
    1 G node#26
        2 G node#25
            3 P x16y16end
            3 P x24y32box
0 G node#28
    1 P x8y8sphere3
    1 P x22y18sphere2
END_HIERARCHY_LIST

The same example of hierarchy list output but with transforms and no pivots:

HIERARCHY_LIST HX 2 top_level
0 G node#27
      tran: 0.0000 0.0000 0.0000
      rot: 0.0000 0.0000 0.0000
      scal: 1.0000 1.0000 1.0000
    1 G node#26
          tran: 0.0000 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 1.0000 1.0000 1.0000
        2 G node#25
              tran: 0.0000 0.0000 0.0000
              rot: 0.0000 0.0000 0.0000
              scal: 1.0000 1.0000 1.0000
            3 P x16y16end
                  tran: 0.0000 0.0000 0.0000
                  rot: 0.0000 0.0000 0.0000
                  scal: 1.0000 1.0000 1.0000
            3 P x24y32box
                  tran: 0.0000 0.0000 0.0000
                  rot: 0.0000 0.0000 0.0000
                  scal: 1.0000 1.0000 1.0000
0 G node#4
      tran: -5.9248 -0.2723 0.0000
      rot: 0.0000 0.0000 0.0000
      scal: 1.0000 1.0000 1.0000
    1 P x8y8sphere3
          tran: 9.6807 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 0.6858 0.6858 0.6858
    1 P x22y18sphere2
          tran: 0.0000 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 1.0000 1.0000 1.0000
END_HIERARCHY_LIST

The same example of hierarchy list output but with both transforms and pivots:

HIERARCHY_LIST HXP 2 top_level
0 G node#27
      tran: 0.0000 0.0000 0.0000
      rot: 0.0000 0.0000 0.0000
      scal: 1.0000 1.0000 1.0000
      sPiv: 0.0000 0.0000 0.0000
      rPiv: 0.0000 0.0000 0.0000
    1 G node#26
          tran: 0.0000 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 1.0000 1.0000 1.0000
          sPiv: 0.0000 0.0000 0.0000
          rPiv: 0.0000 0.0000 0.0000
        2 G node#25
              tran: 0.0000 0.0000 0.0000
              rot: 0.0000 0.0000 0.0000
              scal: 1.0000 1.0000 1.0000
              sPiv: 0.0000 0.0000 0.0000
              rPiv: 0.0000 0.0000 0.0000
            3 P x16y16end
                  tran: 0.0000 0.0000 0.0000
                  rot: 0.0000 0.0000 0.0000
                  scal: 1.0000 1.0000 1.0000
                  sPiv: 0.0000 0.0000 0.0000
                  rPiv: 0.0000 0.0000 0.0000
            3 P x24y32box
                  tran: 0.0000 0.0000 0.0000
                  rot: 0.0000 0.0000 0.0000
                  scal: 1.0000 1.0000 1.0000
                  sPiv: 0.0000 0.0000 0.0000
                  rPiv: 0.0000 0.0000 0.0000
0 G node#4
      tran: -5.9248 -0.2723 0.0000
      rot: 0.0000 0.0000 0.0000
      scal: 1.0000 1.0000 1.0000
      sPiv: -5.9248 -0.2723 0.0000
      rPiv: -5.9248 -0.2723 0.0000
    1 P x8y8sphere3
          tran: 9.6807 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 0.6858 0.6858 0.6858
          sPiv: 3.7558 -0.2723 0.0000
          rPiv: 3.7558 -0.2723 0.0000
    1 P x22y18sphere2
          tran: 0.0000 0.0000 0.0000
          rot: 0.0000 0.0000 0.0000
          scal: 1.0000 1.0000 1.0000
          sPiv: -5.9248 -0.2723 0.0000
          rPiv: -5.9248 -0.2723 0.0000
END_HIERARCHY_LIST

The hierarchy list ends with the tag END_HIERARCHY_LIST to indicate the end of hierarchy processing.

Object Data

There are a number of Object sections, one for each object in the file, as indicated by the NUMBER_OF_OBJECTS info line.

An Object section begins with an object start line. This line starts with an OBJECT_START tag and is followed by the name of the object and counter tags. Each counter tag has a letter prefix (to denote what the counter is for) with a number (how many items of that type there are) appended to it.

The letter v is for vertices, n for vertex normals, t for texture coordinates, and p for polygons. These counters are in the order of:

  1. vertex count
  2. normal count
  3. texture count, and then
  4. polygon count,

regardless of whether or not some the counters are omitted.

For example:

OBJECT_START sphere v26 n45 t45 p32

indicates that the object sphere contains a VERTEX list of 26 vertex positions, a NORMAL list of 45 vertex normal values, a TEXCOORD list of 45 texture (u,v) coordinate values, and a POLYGON list of 32 polygon data entries.

If the OUTPUT_VERT_NORMS flag is off (meaning the output of vertex normals has been omitted) then the n counter, (n45 in the above example), is omitted from the object start line.

Also, if the OUTPUT_TEX_COORDS flag is off (meaning the output of texture coordinates has been omitted) then the t counter, (t45 in the above example), is omitted from the object start line.

USES_MATERIAL tag

The USES_MATERIAL tag indicates which material (if materials are being output) is used for this object. It is followed by the index of the material and the name:

 USES_MATERIAL 0 Shader

VERTEX list

The VERTEX list follows the OBJECT_START line. It begins with a line containing the VERTEX tag along with a coordinate space tag. This second tag is either local or world to indicate whether the position of the vertex is output in local (object) space or in world space. A list of vertex positions specified in X Y Z order (one vertex position per line) follows. If the SHOW_INDEX_COUNTERS flag is on, each vertex line is prefixed with an index number starting at 0 and incrementing by one for each vertex line in the list.

COLORS list

The vertex COLOR list follows the VERTEX list. It begins with a line containing the COLOR tag. A list of the vertex color values then follows.

NORMAL list

The vertex NORMAL list follows the VERTEX list. It begins with a line containing the NORMAL tag. A list of vertex normal values specified in X Y Z order (one vertex normal per line) then follows.

If the SHOW_INDEX_COUNTERS flag is on, each vertex normal line is prefixed with an index number starting at 0 and incrementing by one for each vertex normal in the list.

If the OUTPUT_VERT_NORMS flag is off (meaning the output of vertex normals has been omitted), a NORMAL list will not be found after the VERTEX list.

TEXCOORD list

The following list is the texture coordinate (TEXCOORD) list. It begins with a line containing the TEXCOORD tag. A list of vertex texture coordinate (u,v) values specified in U V order (one texture coordinate pair per line) then follows. If the SHOW_INDEX_COUNTERS flag is on, each line is prefixed with an index number starting at 0 and incrementing by one for each line in the list.

If the OUTPUT_TEX_COORDS flag is off (meaning the output of vertex texture coordinates has been omitted) then a TEXCOORD list will not be found here.

POLYGON list

The next list within an object section is the polygon list for that object. This begins with a line containing only the POLYGON list tag. A list of polygon data lines (one line/entry for each polygon in the object) then follows containing the following data:

where:
index is the polygon i.d. in the list beginning at 0 for the first polygon and incrementing for each entry in the list. This index counter is omitted if the SHOW_INDEX_COUNTERS flag is off.
num_verts is the number of vertices in the polygon.
vert_indices is a list of vertex indices that reference into the object's VERTEX list. There should be a number of indices in this list equal to num_verts.
norm_indices is a list of vertex normal indices that reference into the object's vertex NORMAL list. There should be a number of indices in this list equal to num_verts. These indices are omitted from output if the OUTPUT_VERT_NORMS flag is off.
texcrd_indices is a list of vertex indices that reference into the object's TEXCOORD list. There should be a number of indices in this list equal to num_verts. These indices are omitted from output if the OUTPUT_TEX_COORDS flag is off.
poly_normal (RTG 1.8 only) is the polygons normal vector in X, Y and Z. This entry is omitted if the OUTPUT_POLY_NORMS flag is off.
texture_index (RTG 1.8 only) is an index into a texture table (that can be found at the end of the file provided textures were generated).
rgb_color (RTG 1.8 only) is the polygons color in R, G and B.

(RTG 1.8 only) A polygon will only have either the texture_index OR an rgb_color assignment. The tags v, n, t, N, T, and C exist to identify the data that follows them. These are omitted from the output if their corresponding data is also omitted.

The object data ends with a line containing the OBJECT_END and the name of the object as it appeared on the object start line.

Texture Table (RTG 1.8 only)

The texture table starts with a line containing the TEXTURE_TABLE tag along with the name of the associated texture file (.bin), an entry count, the entries descriptor tag, the header descriptor tag, the number of bytes in the header of the .bin file, and finally the bytes descriptor tag.

Following the first line are the texture entries. Each texture entry line is of the format:

 [index] [pixel_format] [X_res] [Y_res] [source_shader] [byte_size]

where:
index is the texture id in the table, beginning with 0 for the first texture in the table.
pixel_format indicates how the pixel data is stored in the .bin file for this texture. Currently only `RGBA is allowed, meaning the texture in the .bin file is stored 4 bytes per pixel - one each for r, g, b, and a.
X_res s the resolution in x for the texture swatch created.
Y_res is the resolution in y for the texture swatch created.
source_shader is the name of the shader (within PowerAnimator) that generated this texture.
byte_size is the number of total bytes that the pixel data for this texture takes up in the .bin file.

The texture table ends with a line containing the END_TEXTURE_TABLE and the name of the associated texture file (.bin) as it appeared on the texture table start line.

The index counter on each entry is omitted if the SHOW_INDEX_COUNTERS flag is off.

The following is an example of the TEXTURE_TABLE format:

TEXTURE_TABLE wackyB1.bin 3 entries (header: 82 bytes) 0 RGBA 32 32 Shader#2 4096 1 RGBA 32 
32 Shader 4096 2 RGBA 32 32 Shader#4 4096 END_TEXTURE_TABLE wackyB1.bin

The following is an example of the TEXTURE_TABLE format using the encoded texture resolutions option on shader names:

TEXTURE_TABLE wackyB1.bin 3 entries (header: 82 bytes)
0 RGBA 32 32 Shader#2 4096
1 RGBA 32 32 Shader 4096
2 RGBA 32 32 Shader#4 4096
END_TEXTURE_TABLE wackyB1.bin

Texture Data File (.bin) (RTG 1.8 only)

Header

The header of the texture file contains a text title, a version tag, and time and date creation information. This header string is NOT null terminated.

Use the header byte count found in the texture table start line to determine how many bytes to read to clear the header. The version tag is preceded by a ver descriptor tag and the time and date info is preceded by a date descriptor tag.

The header should be parsed to get the version tag and the date in order to verify the texture file against the P-data file.

Data

After the header, any textures generated for the corresponding polygonal data file is dumped pixel by pixel into this file. Each pixel is separated into 4 bytes one for each of R, G, B and A, and written out to this file in that order. Values for each of RGB and A range from 0 to 255. Pixel values are output starting from the bottom-left (texture coord 0,0) and are output moving left to right and bottom to top.

Animation Data (RTG 2.0 only)

RTG 2.0 differs from previous versions of RTG in that it is capable of creating a single file that contains both model and animation data. The RTG 2.0 animation data starts with the tag ANIMATION_LIST, and ends with END_ANIMATION_LIST. Between those two are a sequence of FRAME records and within each frame record is a list of all of the objects that are animated and what their transforms are.

The format of the transformation data is as per the hierarchy section. The following is an example of a three frame animation of two objects.

ANIMATION_LIST
    FRAME 1
        OBJECT sphere#2
            tran: -2.000000 6.000000 0.000000
            rot: 0.000000 0.000000 0.000000
            scal: 1.000000 1.000000 1.000000
            sPiv: -2.000000 6.000000 0.000000
            rPiv: -2.000000 6.000000 0.000000
        OBJECT sphere
            tran: -2.000000 -4.000000 0.000000
            rot: 0.000000 0.000000 0.000000
            scal: 1.125168 1.125168 1.125168
            sPiv: -2.000000 -4.000000 0.000000
            rPiv: -2.000000 -4.000000 0.000000
    FRAME 2
        OBJECT sphere#2
            tran: -2.000000 6.000000 0.000000
            rot: 3.827586 0.000000 0.000000
            scal: 1.000000 1.000000 1.000000
            sPiv: -2.000000 6.000000 0.000000
            rPiv: -2.000000 6.000000 0.000000
        OBJECT sphere
            tran: -2.000000 -4.000000 0.000000
            rot: 0.000000 0.000000 0.000000
            scal: 1.250335 1.250335 1.250335
            sPiv: -2.000000 -4.000000 0.000000
            rPiv: -2.000000 -4.000000 0.000000
    FRAME 3
        OBJECT sphere#2
            tran: -2.000000 6.000000 0.000000
            rot: 7.655172 0.000000 0.000000
            scal: 1.000000 1.000000 1.000000
            sPiv: -2.000000 6.000000 0.000000
            rPiv: -2.000000 6.000000 0.000000
        OBJECT sphere
            tran: -2.000000 -4.000000 0.000000
            rot: 0.000000 0.000000 0.000000
            scal: 1.375503 1.375503 1.375503
            sPiv: -2.000000 -4.000000 0.000000
            rPiv: -2.000000 -4.000000 0.000000
END_ANIMATION_LIST



Bookshelf Contents Previous Next Glossary Index Search

aliasdocs@aw.sgi.com
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.