I simply cannot make the animation look good. if I just add on the translation part, the character becomes an enlarged monkey, if I just add on the rotation part, also it messes up, if I add on the transformation, the character is flattened (the character becomes very thin)
I think the correct way is to add the transformations together. If I just apply one of the mocap or ik transformation alone, the animation is okay. Any ideas?
Thanks
Jack
D3DXVECTOR3 oldpos, oldscale;
D3DXQUATERNION oldquat;
D3DXMatrixDecompose(&oldscale, &oldquat, &oldpos, &frame->TransformationMatrix);
//D3DXMATRIX oldTransform, oldSca, oldRot, oldTrans;
//D3DXMatrixScaling(&oldSca, oldscale.x, oldscale.y, oldscale.z);
//D3DXMatrixTranslation(&oldTrans, oldpos.x, oldpos.y, oldpos.z);
//D3DXMatrixRotationQuaternion(&oldRot, &oldquat);
//oldTransform = oldSca * oldRot * oldTrans;
//newPosition += oldpos;
//newOrientation *= oldquat;
D3DXMATRIX matScale, matTrans, matRot;
D3DXMatrixTranslation(&matTrans, newPosition.x, newPosition.y, newPosition.z);
D3DXMatrixRotationQuaternion(&matRot, &newOrientation);
D3DXMATRIX matFinal;
D3DXMatrixIdentity(&matFinal);
matFinal = matRot * matTrans;
// OLD TRANSFORM IS BVH
// NEW TRANSFORM IS IK
frame->TransformationMatrix = matFinal;
↧