Hi,
I'm stuck into this problem…
I'm trying to implement Linear Blend Skinning, and it works fine if there's only one bone influence, but if more than one, the model's vertices are wrong skinned…
Here's the model screenshot:
The correct model:
//Output Vertex
Math::Vector3 out = Math::Vector3( 0.0f, 0.0f, 0.0f );
//Final Transformation Matrix between bones
Matrix4 mMatrix = Matrix4::Null;
for ( int i = 0; i < 4; i++ )
{
//Set Skinning...
if ( v.faBoneIndice[i] >= 0 )
mMatrix += bones[(int)v.faBoneIndice[i]]->world * v.faWeight[i];
}
//Flip YZ and multiply by the local vertex
out = mMatrix.FlippedYZ() * v.sVertex;
Another question, must be the weights in desc order?
Thanks in advance.