Model Data Structures

Shockwave 3D§ represents model and animation geometry with high-performance data structures that are not convenient targets when converting data from an authoring tool. As a result, the exporter first converts these authoring tool data structures to easy conversion targets, called authoring data structures (IFXAuthorMesh, IFXAuthorBones, and IFXAuthorUpdateRecordGroup). Once converted, these data structures are compiled to produce the final run-time data structures (IFXMesh, IFXBones, IFXUpdatesGroup) used in the Shockwave 3D scenegraph.

Authoring Data Structures

The authoring data structures offer an authoring view, as opposed to a run-time view, of a 3-D mesh.

IFXAuthorMesh and IFXAuthorMeshGroup

This data structure is easy to manipulate because it can contain faces that reference multiple materials and has vertex positions on material or attribute boundaries that are not replicated. As a result, this structure is not efficient for rendering until it is compiled into an IFXMesh structure.

IFXAuthorFace

This data structure provides an authoring view of geometry topology—how vertices and their attributes are connected—and abstracts how face data is stored. It refers to all attributes with integer indices (IFXAuthorGeomIndex) stored in continuous arrays in IFXAuthorMesh. Example attributes include position, normals, texture coordinates, and vertex colors.

See also IFXAuthorMesh and Shaders

Run-Time Data Structures

The IFXMesh data structures are material partitioned, store attributes in memory layouts native to OpenGL§ and Direct3D§, and take advantage of vertex array rendering primitives.

IFXMesh and IFXMeshGroup

IFXMeshGroup and IFXMesh subclass data structures contain a set of faces and vertices that share a single material. With this structure the graphic engine can use each IFXMesh to set a single material state and render all IFXMeshes that use the same material. This works to minimize processing and memory costs of material state changes.

IFXUpdatesGroup

Multiresolution mesh models require two closely related data structures: a pure geometrical 3-D mesh with contiguous arrays of vertices, faces, and attributes; and a record that explains how to update a mesh to increase or decrease resolution. The former role is carried out by IFXMeshGroup/IFXMesh structures and the latter by an update record structure that enables multiresolution operations on material partitioned, vertex array-aligned IFXMeshes—the IFXUpdatesGroup.

Just as IFXMeshGroup contains IFXMeshes, IFXUpdatesGroup contains IFXUpdates. Each IFXMesh in an IFXMeshGroup has a corresponding IFXUpdates object in the IFXUpdateGroup object. Each IFXUpdates object manages a list of IFXResolutionChange and IFXFaceUpdate objects, which contain the actual data for performing incremental resolution changes to multiresolution meshes.

The IFXUpdatesGroup and IFXUpdates structures are integral elements of the material partitioned and vertex array organization of the IFXMeshGroup and IFXMesh structures. Vertices that lie on a material boundary are shared by at least two faces with different material associations. These vertices are replicated and exist in the IFXMesh objects for each of the two materials. Changes in vertex resolution are done in terms of "units" rather than vertices. For vertices on the interior of an IFXMesh, a unit constitutes one vertex. However, for those vertices shared by more than one IFXMesh, the unit represents all of those shared vertices. The bookkeeping that maps units to vertices is kept in the "sync" tables structure owned by the IFXUpdatesGroup object.

All of the internal bookkeeping is managed transparently to the user if the IFXMultiResManager class is used for changing the resolution of the mesh.

IFXVertexMap

IFXVertexMaps are created at the same time as IFXMeshGroups and IFXMeshes. The vertex maps translate mesh indices from a continuous mesh data structure to the material partitioned IFXMeshGroup/IFXMesh data structures. Whenever a content creator specifies multiple normals, texture coordinates, or multiple materials coincident at a particular mesh vertex, the vertex data is replicated across IFXMeshes for each unique attribute. This enables IFXMesh to support high performance vertex array rendering primitives. The vertex map explains how this replication occurred, mapping each original vertex index to a usually short list of IFXMesh:vertex Index pairs.

Vertex maps may be useful for some authoring-time or load-time algorithms that operate on the mesh as though it were a continuous surface. For example, both IFXNeighborMesh creation and the IFX Animation Load Time vertex weight regeneration and smoothing algorithms use IFXVertexMap data to perform tasks.

IFXNeighborMesh

IFXNeighborMesh is a companion data structure to an IFXMeshGroup. It provides connectivity information—which may not be readily available from the IFXMeshGroup and IFXMesh data structures—indicating that two faces in a model, for example, are neighbors even if they are of different materials.

IFXNeighborMesh determines the faces that are adjacent to a face, the relative orientation of the adjacent faces, the shared edges, and the shared vertices. Two or more faces are considered to be adjacent if they share an edge. Edges from two faces are considered the same if their vertex positions are equal. The primary information stored by the neighbor mesh is the oriented and complete adjacency relationships of faces.

Each triangle in the mesh stores three references or pointers to vertices. When viewing a triangle from the front, the references are ordered either clockwise if using the left-hand rule, or counterclockwise if using the right-hand rule.

Unified View of Material Partitioned Mesh

IFXMeshGroup is a material partitioned mesh with vertices on material boundaries duplicated in multiple meshes. Since each mesh has vertex indices starting at zero, the boundary vertices may have different indices in each mesh. Edges along a material boundary have vertices with the same positions, and are thus considered the same—even though the vertex indices may be different. Faces that share edges along the material boundary are considered adjacent. As a result, the neighbor mesh spans all the material partitioned meshes and allows you to view the partitioned meshes as a whole. With this view, the partition indices are simply a property of the face.

 

 

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.