[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.16.1 Common Model Data Structure (iModelData)

The IDS is built by a simple concept. All components implement iObject. Except a few cases, the structure is built using the iObject hierarchy. The following components are currently used:

Scene

This is the main object. It contains any number of objects, light sources, cameras, materials and textures.

Texture

An image, which can be stored as an iImage, an iTextureWrapper, or a filename.

Material

A material, which can be stored as an iMaterial or an iMaterialWrapper.

Camera

A camera that looks into the scene. It currently contains a position and up, front and right vectors.

Light Source

A light source, consisting of position, brightness and color.

Vertex Frame

This is a collection of any number of vertex positions, any number of normal vectors, of color values and of texture coordinates (also called texels).

Polygon

A list of quadruples of index values. Every entry in the list contains an index for a vertex table, an index for a normal table, one for a color table and one for a texel table. To produce meaningful output, a polygon has to be used together with a vertex frame object.

Object

This is what model importing is usually about. An object can be as much as a complete level or as few as one polygon. It is simply something that you can build a mesh object from. This means that it doesn't even have to use polygons (it could use curves instead). This object itself is hardly more than a node in the iObject hierarchy.

Sub-objects are currently organized in a way that is closely related to the thing and sprite meshes used in CS: Every object contains a Default Vertex Frame, which is (of course) a vertex frame object. Also, an object contains any number of polygon objects. Take these together and you have the static shape of an object (and also the shape that is used when you build a thing mesh from it).

Action

For sprites, it is more difficult as you also want animation. An IDS object can also contain any number of action objects. An action is a list of frames and time values. Frames are also handled as generic IDS objects. However, they are special in the way that they are not contained in the action as iObject children but rather directly though the iModelDataAction interface. Currently the only types of frames that are allowed are vertex frames.

Finally, the time value system has to be explained. Time values are stored in a rather unusual way: The time that is stored with each frame is the point in time when the frame ends. For example, if the first frame lasts 50 msec, then the time value stored with it is 50 msec. If the second frame lasts 30 msec, its time value is 80 (50+30). The last time value is also the total length of one animation cycle. Note that for interpolated animation this produces another effect: At the point zero in time, the frame to show is equal to the last stored frame. The animation then moves on to the first time value, shifting the frame to show over to the first stored frame.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated using texi2html 1.76.