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

7.9.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

Use the `iSprite3DFactoryState' SCF interface to access settings for a 3D sprite factory. The definition of this interface can be found in `CS/include/imesh/sprite3d.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/imesh/sprite3d.h') and for skeletal animation you need to work with `iSkeletonLimb', `iSkeletonConnection', and `iSkeleton' (defined in `CS/include/imesh/skeleton.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>materialname</material>
Material to use for the sprite.
<frame name="framename"><v x="" y="" z="" u="" v="" /> ...
Define one frame. A frame is a list of vertices which are specified using the `v' tag. 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 name="actionname"><f name="framename"><delay>
Define one action. An action is a list of frames. Every frame is annotated with the `f' tag which contains the name of the frame to use and a delay.
<skeleton name="skeletonname"> ...
Define a skeleton. See below for tags in skeleton.
<t v1="" v2="" v3="" />
Define one triangle. The three parameters are the indices for the three triangle vertices.
<smooth>base/frame</smooth>
Defines how to apply normal smoothing on the sprite.
<tween>yes/no</tween>
Set to yes if you want to enable frame tweening. Default is false.

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

<limb name="limbname"> ...
A limb defines a connection to a child limb. This is where the hierarchy kicks in. Inside `limb' you use the same tags as on this level.
vertices <v v1="" ... />
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/imesh/sprite3d.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/imesh/sprite3d.h':

Object Loader

<factory>factoryname</factory>
Name of the factory to use for creation of this instance.
<mixmode><mode \></mixmode>
Blending mode, one of `add', `alpha', `copy', `keycolor', `multiply2', `multiply', or `transparent'.
<material>materialname</material>
Material to use for the sprite.
<tween>yes/no</tween>
Set to yes if you want to enable frame tweening. Default is false.
<lighting>yes/no</lighting>
Set to yes if you want to enable lighting. Default is true.
<basecolor red="" green="" blue="" />
Base color that will be added to all vertex colors. Default 0,0,0.
<action name="actionname">
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