20

I am getting Matrix3.getInverse(): can't invert matrix, determinant is 0 three.js 3976 error when I am trying to scale a cube object.

var object = new.THREE.Mesh(geometry, material)
 xScale = 0.1;
 object.scale.x = object.scale.y = object.scale.z = xScale;

Could someone help me out of this.

user2788945
  • 273
  • 1
  • 3
  • 8

2 Answers2

17

Matrix3.getInverse(): can't invert matrix, determinant is 0 usually happens when either the scale.x, scale.y or scale.z are 0. Make sure you're not scaling the object to 0.

mrdoob
  • 19,334
  • 4
  • 63
  • 62
0

I think you may be trying to use a Matrix3 where a Matrix4 is required. At least in r61 of the three.js library, the line you refer to is pulling from the matrix array beyond index 8 (ie. a 16 element matrix vs. a 9 element). If you need any advice beyond that provide some code and description to what your trying to achieve with the inverse matrix, good luck!

Darryl_Lehmann
  • 2,178
  • 15
  • 21