Hello everyone, today I want ask for help. I'm with friend already have some progress, but as you can see by clicking this

something goes wrong (on this GIF file should be Dervish Spin skill)
render code:
Code:
for (int i = 0; i < m_boneCount; i++)
{
if (m_frames[i].frames)
{
frame = &m_frames[i].frames[currentFrame];
next = &m_frames[i].frames[nextFrame];
D3DXQuaternionSlerp(&slerp, &frame->rot, &next->rot, slp);
D3DXVec3Lerp(&lerp, &frame->pos, &next->pos, slp);
D3DXMatrixTranslation(&m1, lerp.x, lerp.y, lerp.z);
D3DXMatrixRotationQuaternion(&m2, &slerp);
m2 *= m1;
if (m_bones[i].parentID != -1)
m2 *= bones[m_bones[i].parentID];
}
else
{
m2 = m_frames[i].TM;
if (m_bones[i].parentID != -1)
m2 *= bones[m_bones[i].parentID];
}
bones[i] = m2;
}
structure:
short unknown1
short unknown2
short frame_size
short unknown3
short number_of_bones
for (number_of_bones) {
int parent_bone_index
float[16] bone_coords
int number_of_rotation_keyframes
for (num_rot_kf) {
int timestamp
float x
float y
float z
float w
}
int number_of_translation_keyframes
for (num_trans_kf) {
int timestamp
float dx
float dy
float dz
}
}
If someone can help with it - feel free to comment here.