Under which conditions is the IbmMatrixFloatChecker used?
cansik opened this issue · 2 comments
I am currently writing an exporter for a skinned human mesh into glTF and I am experiencing some problems with the inverse binding matrices. The validator always outputs that the values of the IBM are not valid. This happens for all translation indices in the matrix:
Error | Message | Pointer |
---|---|---|
ACCESSOR_INVALID_IBM | Matrix element at index 3 (component index 3) contains invalid value: -0.028548847883939743. | /skins/0/inverseBindMatrices |
ACCESSOR_INVALID_IBM | Matrix element at index 7 (component index 7) contains invalid value: -0.09395316243171692. | /skins/0/inverseBindMatrices |
ACCESSOR_INVALID_IBM | Matrix element at index 11 (component index 11) contains invalid value: 0.016649797558784485. | /skins/0/inverseBindMatrices |
ACCESSOR_INVALID_IBM | Matrix element at index 19 (component index 3) contains invalid value: -0.03953598067164421. | /skins/0/inverseBindMatrices |
ACCESSOR_INVALID_IBM | Matrix element at index 23 (component index 7) contains invalid value: -0.32329368591308594. | /skins/0/inverseBindMatrices |
ACCESSOR_INVALID_IBM | Matrix element at index 27 (component index 11) contains invalid value: 0.02958018146455288. | /skins/0/inverseBindMatrices |
and more for each joint 3 times
So I tried to find out why this error happens and I found the IbmMatrixFloatChecker which is only true if all the translation indices of the IBM are 0
. The IbmMatrixFloatChecker is used here to add the check, but I can not really find out, why for example the glTF Skinning example does not have any problem passing this check. There the IBM of joint 1 has a -1
at the y
-axis (at a translation index).
What are the precondition that lead to that check? When is a translation in the IBM valid?
glTF 2.0 matrix accessors are stored in column-major order (see Section 3.6.2.4. Data Alignment in the spec). So matrix elements with component indices 3, 7, 11, and 15 correspond to the 4th row, not the translation.
@lexaknyazev Oh wow, thanks for the hint! Numpy's flatten
by default uses row-major and I was not aware of that.