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;
};