In this code from the skinning tutorial:
update(node) {
const globalWorldInverse = m4.inverse(node.worldMatrix);
// go through each joint and get its current worldMatrix
// apply the inverse bind matrices and store the
// entire result in the texture
for (let j = 0; j < this.joints.length; ++j) {
const joint = this.joints[j];
const dst = this.jointMatrices[j];
m4.multiply(globalWorldInverse, joint.worldMatrix, dst);
m4.multiply(dst, this.inverseBindMatrices[j], dst);
}
I understand joint.worldMatrix holds the joint global pose matrix. inverse bind matrix is self explanatory. But what about globalWorldInverse? Where is this matrix coming from and why do we need to multiply it.
In this code from the skinning tutorial:
I understand joint.worldMatrix holds the joint global pose matrix. inverse bind matrix is self explanatory. But what about globalWorldInverse? Where is this matrix coming from and why do we need to multiply it.