Can't get the animation to work (THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0)

Hi guys. It’s my first time posting here so take it easy on me.

I’ve asked our art director to create a quite complex animation on 3DS Max and have it exported as an FBX for Blender and then to GLTF for THREE.JS

After exporting and running on Don McCurdy’s GLTF Viewer (https://gltf-viewer.donmccurdy.com/) it started throwing thousands of warnings like the below (as long as the looped animation runs):

(THREE.Matrix3: .getInverse() can’t invert matrix, determinant is 0)

Can you let me know where to start to try solving this? I’m using the latest ThreeJS release as of date (r99) and the latest GLTFLoader.

I tested this on Chrome and Firefox. I would also like to add that the animation itself doesn’t load but it does load on the GLTF Viewer mentioned above, although having the same thousands of errors as well.

What do you think am I missing?

Thanks in advance to anyone who would help.

John

Can you please share your glTF model in this topic?

As mentioned in the following thread at stackoverflow, the error might occur if your objects have a zero scaling.

I had the same issue with ArrowHelper.
The arrow helper’s length should be bigger than headLength.
Otherwise it is child Line’s scale.y will be 0. and causes this issue.
https://threejs.org/docs/#api/en/helpers/ArrowHelper

1 Like

I had the same problem with an application that scaled the mid section of a ship hull automatically. When the scale was zero, I got errors/warnings in the console. To avoid the warning, I had to add logic to hide the part when the scale was zero.

If this comes from the loaded models, is there any chance that scaling has been “abused” in the modelling process, e.g. setting scale to 0 to remove a part temporarily? If so, you may try something like this:

model.traverse(function (obj) {
    const s = obj.scale;    
    if (s.x === 0 || s.y === 0 || s.z === 0) {
        obj.visible = false;
    }
})

Doc page: https://threejs.org/docs/#api/en/core/Object3D
Source (Object3D.traverse): https://github.com/mrdoob/three.js/blob/7e0a78beb9317e580d7fa4da9b5b12be051c6feb/src/core/Object3D.js#L509

1 Like

@mudin Should be fixed with the upcoming release R109: