Save polygons

Purpose

To export render file data to other systems, such as polygon-based animation systems.

How to Use

  1. Select Save polygons. The Alias File Requestor is displayed.

  2. Click the Show List button to open the File Lister.

  3. Click the filename in the file lister. If you prefer, you can type the filename and/or the path in full, without selecting anything in the File Lister. The filename and its UNIX path appear in the Alias File Requestor.

  4. Click the Save Polygons button. Tip: You can also double-click the file's icon to access the file. The Alias File Requestor overwrites the selected file with the new file.

Save Polygons Options

Select Save polygons- to display the Polygon File Output Options box.

Output Type-Triangles

The file is triangulated according to the subdivision values found in Windows Render stats, or if the Quality Type is set to GLOBAL in the Render Globals Quality Parameters window (Render Globals). See the following.

See Windows Render stats or Render Globals for more information.

Note: The Triangles format can be used with the sla and surfmate standalones.

Object Type-Quads

The Quads option is useful if you need to output quadrilateral geometry with texture maps attached. The following Texture Subdivs slider is displayed when you select this option.

The value in this slider specifies the number of U and V texture samples per polygon.

Object Separators

Turn this toggle ON to provide additional information, including hierarchy, per vertex normals and texture sub samples. This format is used with alias_to_wave and alias_to_sgo conversion programs, as well as for programming purposes.

Naming Textures

Due to the object-oriented approach to Alias shaders, the filename used for a texture map is not available to print out, so it is important that you name the texture the same name as the file from which the texture comes. This can easily be done in the Multi-lister by double-clicking on the texture's name and replacing it with the name of the file it represents.

Example:

After applying a file texture to a shader, the default name of the texture appears just below the texture icon in the Multi-lister (for example, File#13).

  1. Type the name of the file texture you are going to use for this shader in File#13's editor (for instance, cloth). So that the object knows the name of the image file, name the texture the same as the image file.

  2. Double-click on the name File#13 in the Multi-lister and type the name cloth,
or

  • Type cloth in the Name field of File#13's editor. Now when the triangle file is written, the object will indicate that the texture assigned to it is named cloth.

    Object Separated Triangle Output File Format

    The following defines are used to delineate objects.

    #define FLOAT_START 99999.0

    #define FLOAT_END -FLOAT_START

    Each triangle file is composed of lists of numbers output in machine format. A triangle is made up of three normals, vertices, colors, and parametric coordinates. Objects are delineated by two arbitrary floating point values, which are too large to be valid surface normal values. The starting floating point value marking an object is followed by a null terminated string (the object's name), a single integer representing a count of the number of triangles in this object, and finally, the name of the texture applied to this object (if any).

    Object Separated Triangle Format

    The object separated triangle format can be illustrated by:

    FLOAT_START /* Marks start of an object (float) */

    name /* A NULL terminated string (chars) */

    count /* Number of triangles to follow. (int) */

    texture_name /* A NULL terminated string (chars) naming */

    nx ny nz /* Normal, vertex 1 (floats)*/

    fx fy fz /* Vertex 1, triangle 1 (floats)*/

    cr cg cb /* The color of vertex 1. 0-255 (floats) */

    u v /* U,V of vertex 1 (floats) */

    nx ny nz /* Normal, vertex 2 */

    fx fy fz /* Vertex 2, triangle 1 */

    cr cg cb /* The color of vertex 2. 0-255 */

    u v /* U,V of vertex 2 */

    nx ny nz /* Normal, vertex 3 */

    fx fy fz /* Vertex 3, triangle 1 */

    cr cg cb /* The color of vertex 3. 0-255 */

    u v /* U,V of vertex 3 */

    etc...

    FLOAT_END /* Marks the end of an object */

    name /* - name of object just terminated */

    FLOAT_START

    etc....

    Zero Count Objects

    If the number of triangles for a given object is zero (0), then the object is a collection of other objects that may or may not contain triangles, or other sub-groups of objects. In other words, zero count objects describe the hierarchy or DAG associated with the model. For example, a model of an arm might look something like this (if translated into plain text and formatted):

    FLOAT_START

    arm

    0

    FLOAT_START

    hand

    0

    FLOAT_START

    thumb

    567

    (567 triangles here)

    FLOAT_END

    thumb

    FLOAT_START

    finger

    2143

    (2143 triangles here)

    FLOAT_END

    finger

    (3 other fingers here)

    FLOAT_END

    hand

    FLOAT_START

    elbow

    345

    (345 triangles here)

    FLOAT_END

    elbow

    (some other arm-related objects here)

    FLOAT_END

    arm

    For an example of how to read a triangle file, see /usr/alias/Gifts/src/reader/reader.c

    Object Separated Quadrilateral Output File Format

    The quadrilateral output file format is provided to allow tessellated output in another form besides triangles, and output texture information if it exists. Each quadrilateral corresponds to the subdivided approximations to the surface created during the Alias triangle tessellation phase of rendering, so the higher surface subdivisions are set in the Render Stats spreadsheet editor, the more quadrilaterals are produced for that surface.

    Should the object be textured on the color channel, each quadrilateral can have a texture swatch on it. The swatch is created by doing a uniform parametric sampling of the texture across the quadrilateral. In addition to the texture swatch, the name of the texture assigned is included at the head of each object, and the hierarchy of the model is maintained.

    This feature is accessed by setting a shell ENVIRONMENT variable from a Unix shell window, and then running Alias from that window. The command to set the ENVIRONMENT variable is as follows:

    setenv QUAD_OUTPUT 16
    If the above environment variable is set to any positive integer, excluding zero (0), then quadrilaterals instead of triangles are output into the file when you select the Object Separators option of the triangle output menu. The number that QUAD_OUTPUT is set to controls the resolution of the texture swatch created in the file. For example, using the above setting of 16, the texture swatches produced in the quad file would be of 16 by 16 pixels.

    The following defines are used to delineate objects.

    #define FLOAT_START 99999.0

    #define FLOAT_END -FLOAT_START

    Quadrilateral files are composed of lists of numbers output in binary encoded format (that is, not human readable). A quadrilateral is made up of four normals, vertices, and parametric coordinates. Objects are delineated by two arbitrarily large floating point values, which are too large to be valid surface normal values.

    The starting floating point value marking an object is followed by a null terminated string (the object's name), a single integer representing a count of the number of quadrilaterals in this object, and then if the number of quadrilaterals is non-zero, the NAME of the texture applied to the object (if any). If there is no texture applied to the object, a single, null character is printed.

    Note: In some cases, Alias is forced to write triangles instead of quadrilaterals- near the edge of trim curves, some faces, triangle polysets, and so on. In such a case, a quadrilateral is printed for every field in the last vertex that is set to 111.3, and the texture array is always 1 by 1. (The number 111.3 was chosen because it is a floating point number that gets written exactly with fprintf. Not all floating point numbers have this property).

    Object Separated Quadrilateral Format

    The quadrilateral format can be illustrated by:

    FLOAT_START /* Marks start of an object (float) */

    name /* A NULL terminated string (chars) */

    count /* Number of quads to follow. (int) */

    texture_name /* A NULL terminated string (chars) naming */

    nx ny nz /* Normal, vertex 1 (floats)*/

    fx fy fz /* Vertex 1, quadrilateral 1 (floats)*/

    u v /* U,V of vertex 1 (floats) */

    nx ny nz /* Normal, vertex 2 */

    fx fy fz /* Vertex 2, quadrilateral 1 */

    u v /* U,V of vertex 2 */

    nx ny nz /* Normal, vertex 3 */

    fx fy fz /* Vertex 3, quadrilateral 1 */

    u v /* U,V of vertex 3 */

    nx ny nz /* Normal, vertex 4 */

    fx fy fz /* Vertex 4, quadrilateral 1 */

    u v /* U,V of vertex 4 */

    s t /* Two ints for resolution of texture swatch */

    texture_swatch /* s times t Rgba structures. */

    etc...

    FLOAT_END /* Marks the end of an object */

    name /* - name of object just terminated */

    FLOAT_START

    etc....

    If the number of quadrilaterals for a given object is zero (0), then the object is a collection of other objects that may or may not contain quadrilaterals, or other sub-groups of objects. In other words, the zero count objects describe the hierarchy or DAG associated with the model.

    For example, a model of an arm might look something like this (if translated into plain text and formatted).

    FLOAT_START

    arm

    0

    FLOAT_START

    hand

    0

    FLOAT_START

    thumb

    567

    (567 quadrilaterals here)

    FLOAT_END

    thumb

    FLOAT_START

    finger

    2143

    (2143 quadrilaterals here)

    FLOAT_END

    finger

    (3 other fingers here)

    FLOAT_END

    hand

    FLOAT_START

    elbow

    345

    (345 quadrilaterals here)

    FLOAT_END

    elbow

    (some other arm-related objects here)

    FLOAT_END

    arm

    For an example of how to read a quad file, see /usr/alias/Gifts/src/reader/qreader.c

    Note: Polysets are written out in this format. However, if you have already converted your object to a triangular polyset and then choose quad output, only triangles are printed-triangles are not welded back to being quads.You can preview what kind of triangles will be coming out by using the convert to polygons feature in the Alias interactive package.





    aliasdocs@aw.sgi.com
    Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.