thanks a massive amount,
I've fixed 4. at which point the vertices started moving, I fixed 3. and 2. silly mistakes from when I was panicking on why it wasn't working.
5. I'm not sure what you mean, I assume you mean ALL inverse bind matrices need to be passed to the shader (animated once being multiplied by the transform), either that or you mean I need to generate key frames for every single bone animated or not.
Say you have shoulder, elbow and wrist joint in your skeleton. Shoulder joint is animated. At the moment, your code is sending shoulder joint to vertex shader but not the elbow and wrist joints (because only shoulder joint has animation keyframes), so vertices that are weighted to elbow and wrist joints are going to be broken. I think the issue was somewhere around your CreateAnimationClass logic. Using your anon.dae model, only 31 "NodeClass"es are being passed into CreateAnimationClass, despite the fact that anon.dae model has ~40 joints in its joint hierarchy.
1. I think I've got... I'm not sure though because the whole thing is still a mess of vertices, this may be 5.s problem though
unsigned short _currentIndex = _nodeIndices[_i].first;
_tempMatrix = _currentBone->mOffsetMatrix.Inverse();
_inverseBindTransforms[_currentIndex] = D3DXMATRIX(_tempMatrix.a1, _tempMatrix.a2, _tempMatrix.a3, _tempMatrix.a4,
_tempMatrix.b1, _tempMatrix.b2, _tempMatrix.b3, _tempMatrix.b4,
_tempMatrix.c1, _tempMatrix.c2, _tempMatrix.c3, _tempMatrix.c4,
_tempMatrix.d1, _tempMatrix.d2, _tempMatrix.d3, _tempMatrix.d4);
Does this seem about right? this is in the for loop for bones, the transforms are sent to the animation class where this happnes:
D3DXMATRIX* ::AnimationClass::GetTransforms(double p_time)
{
D3DXMATRIX* _result = new D3DXMATRIX[64];
for (unsigned short i = 0; i < 64; i++)
{
if (i > m_owner->GetBoneCount())
{ break; }
else
{ _result = m_inverseBindTransforms; }
}
for (map<unsigned short, NodeClass>::iterator i = m_nodes->begin(); i != m_nodes->end(); i++)
{
(*i).second.CalculateTransform(p_time);
_result[(*i).first] = m_inverseBindTransforms[(*i).first] * (*i).second.GetCompleteTransform();
}
return _result;
}
Looks about right.