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

7.8.5 Sprite3D Mesh Object

Written by Jorrit Tyberghein, jorrit.tyberghein@uz.kuleuven.ac.be.

A 3D Sprite is a complex set of 3D triangles that either supports frame based animation or else skeletal animation.

Basic Structure

The following SCF class names are used (for CS_LOAD_PLUGIN()):

Objects in this plugin implement the following SCF interfaces (get with SCF_QUERY_INTERFACE()):

Factory State Interface

`iSprite3DFactoryState' is the SCF interface that you can use to set/get settings for a 3D Sprite factory. The definition of this interface can be found in `CS/include/imspr3d.h' and that is also the include file you need to include in your applications to use this plugin. Using this interface you can access the material, triangles, vertices, texture coordinates, normals, frames, actions, skeletal structure, and various other configuration parameters for a 3D sprite factory.

For frame based animation you need to access the `iSpriteFrame' and `iSpriteAction' interfaces (defined in `CS/include/imspr3d.h') and for skeletal animation you need to work with `iSkeletonLimb', `iSkeletonConnection', and `iSkeleton' (defined in `CS/include/iskel.h'). Note that you will also have to setup one frame if you use skeletal animation. This frame defines the default setup of the sprite if the skeleton is at rest (i.e. all transformations in the skeleton connectors are identity transformations).

Factory Loader

MATERIAL
Material to use for the sprite.
FRAME
Define one frame. A frame is a list of vertices which are specified using the `V' keyword. Every vertex has a 3D position in object space and (u,v) coordinates in the given texture (from 0 to 1). Note that every frame needs to have the same number of vertices.
ACTION
Define one action. An action is a list of frames. Every frame is annotated with the `F' keyword which contains the name of the frame to use and a delay.
SKELETON
Define a skeleton. See below for keywords in skeleton.
TRIANGLE
Define one triangle. The three parameters are the indices for the three triangle vertices.
SMOOTH
Defines how to apply normal smoothing on the sprite.
TWEEN
Set to true if you want to enable frame tweening. Default is false.

A skeleton is a hierarchial structure which is defined as follows:

LIMB
A limb defines a connection to a child limb. This is where the hierarchy kicks in. Inside `LIMB' you use the same keywords as on this level.
VERTICES
This is a list of vertex indices from the main frame. This limb will control the given vertices.
TRANSFORM
Specify the default transformation to use for this limb with relation to its parent (cannot be used on the top level).

Object State Interface

`iSprite3DState' is the SCF interface that you can use to set/get settings for a 3D Sprite object. The definition of this interface can be found in `CS/include/imspr3d.h' and that's also the include file you need to include in your applications to use this plugin. Using this interface you can access the material, blending mode (mixmode), current frame and action, current skeletal animation state, and various other configuration parameters for a 3D sprite object.

The state of a skeleton is described via the following interfaces which are defined in `CS/include/imspr3d.h':

Object Loader

FACTORY
Name of the factory to use for creation of this instance.
MIXMODE
Blending mode, one of `ADD', `ALPHA', `COPY', `KEYCOLOR', `MULTIPLY2', `MULTIPLY', or `TRANSPARENT'.
MATERIAL
Material to use for the sprite.
TWEEN
Set to true if you want to enable frame tweening. Default is false.
LIGHTING
Set to true if you want to enable lighting. Default is true.
BASECOLOR
Base color that will be added to all vertex colors. Default 0,0,0.
ACTION
The default action to use for this sprite instance.

Configuration Parameters

The `sprite3d' plugin supports the following configuration parameters via the `iConfig' interface in the mesh object type plugin:

sprlod
Set the sprite level-of-detail (LOD) level.
sprlq
Set the sprite lighting quality.

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

This document was generated using texi2html