Constructing animations from joints

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
utunnels
Posts: 37
Joined: Thu Apr 05, 2012 2:52 pm

Constructing animations from joints

Post by utunnels »

Let me explain my situation first.

I'm trying to convert a custom format to mesh and animate it. The first step is relatively easy to me as long as I can set up the vertices position correctly. The second step, however, I'm not sure how to start. Should I create a class based on ISkinnedMesh or SAnimatedMesh?

What I've already done:

1. Get enough vertices and faces informations.
2. Get the joints informations (rotation, position, weight, group of vertices that belongs to current joint, etc).

With 1&2, I've already made a custom scene node and animated it successfully. But to use further features of irrlicht I'll have to go the mesh/bone/joint way sooner or later. Can someone make me an example on how to do that?

The joint structure is something like this:

Code: Select all

struct Joint
{       
  vector3df Rotation; //relative
  vector3df Position; //relative
  u16 VertexGroupIndex;  //index of the vertext group 
  u16 ParentJointIndex;
};
 
struct VertexGroup
{
  array<u16> VertexList; // a list of vertices currently attached to one or two joints
  u16 JointIndices[2];
  float Weights[2];
  u16 NumJoints;
};
 
The animation frames are a set of new positions and rotations of the joints.
Post Reply