0

I want to multiply 2 matrices with the gl-matrix.js library gl matrix mat4

The multiplication does work f.e. this :

    var testMat = mat4.create();
    mat4.multiply(testMat, this._transformations[0].transformation, this._transformation.transformation);

Where this._transformation[x].transformation is a matrix.

But it doesnt work when doing this :

    mat4.multiply(this._transformations[0].transformation, this._transformations[0].transformation, this._transformation.transformation);

Which means the matrix stored in this._transformations[0] is still the same after the multiplication.

Has someone an explanation for this or can tell me what i am doing wrong?

Edit : console.log(mat4.equals(mat4.create(),this._transformations[0].transformation)) returns true

LJᛃ
  • 7,655
  • 2
  • 24
  • 35
greedsin
  • 1,252
  • 1
  • 24
  • 49
  • You have not given enough information. There is no reason your calls should not work. Unless the you are multiplying by an identity matrix the out matrix (first argument) should be the product of the next two. You need to show the incorrect result and the original matrix's content so we have something to go by. – Blindman67 Dec 08 '16 at 16:30
  • https://developer.chrome.com/devtools – LJᛃ Dec 08 '16 at 16:31

0 Answers0