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.

4
  • 3
    object.scale.set(xScale, xScale, xScale) Commented Oct 3, 2013 at 8:15
  • 2
    Uhura meant object.scale.set(xScale, yScale, zScale) Commented Mar 19, 2014 at 4:40
  • 2
    @uhura Why is that required? object.scale is a Vector3 so it ought to be modified exactly in the same way as (e.g.) object.position... In fact using set doesn't solve anything (just tried). Commented Jun 6, 2014 at 14:36
  • anyone solved this? :'( Commented Nov 25, 2015 at 13:14

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.