mrdoob/three.js — pull request #4272 by bhouston (2014-01-06 17:04:11+00:00)
Title: Matrix4 decompose bug

There was a bug in Matrix4.decompose that would not properly account for a negative determinant matrix. It would take the absolute scale vector, but if the matrix has a negative determinant, either one or two of these need to be negative or the results are not a properly decompose.

BTW this technique of just inverting one of the components of the scale for negative determinant matrices is common, see last paragraph on this page: http://callumhay.blogspot.ca/2010/10/decomposing-affine-transforms.html

I wrote a unit test for Matrix4.compose/decompose that would fail without this fix and now it passes correctly.