Whatever the matrix A, I can compute its inverse with invA = A.invert(). The resulting matrix is correct, as MATLAB confirms
Yet, I then try invA.multiply(A) and A.multiply(invA), where I expect the identity matrix. But the result is a complete mess, far from identity matrix. I should be missing something important regarding BabylonJS and the inner working of its matrices, could you help me figure it out?
Thanks a lot!
PS: You can figure out that itβs not even element-wise multiplication
I think matrix multiplication is not commutative in general. So invA.multiply(A) and A.multiply(invA) do not give the same result. I think you can also verify that in MATLAB.
The issue is that the matrix.invert() actually inverts the matrix in place, ie it changes the input matrix to its inverse. Matrix | Babylon.js Documentation