{"action":"created","issue":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/4317","labels_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/4317/labels{/name}","comments_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/4317/comments","events_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/4317/events","html_url":"https://github.com/openframeworks/openFrameworks/issues/4317","id":103891007,"number":4317,"title":"ofMatrix4x4::decompose() decomposes scale incorrectly","user":{"login":"procedural","id":1072168,"avatar_url":"https://avatars.githubusercontent.com/u/1072168?v=3","gravatar_id":"","url":"https://api.github.com/users/procedural","html_url":"https://github.com/procedural","followers_url":"https://api.github.com/users/procedural/followers","following_url":"https://api.github.com/users/procedural/following{/other_user}","gists_url":"https://api.github.com/users/procedural/gists{/gist_id}","starred_url":"https://api.github.com/users/procedural/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/procedural/subscriptions","organizations_url":"https://api.github.com/users/procedural/orgs","repos_url":"https://api.github.com/users/procedural/repos","events_url":"https://api.github.com/users/procedural/events{/privacy}","received_events_url":"https://api.github.com/users/procedural/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-30T00:18:15Z","updated_at":"2015-09-02T20:38:58Z","closed_at":"2015-08-30T12:03:58Z","body":"I have a project that requires negative matrix scale by one of the axes, but the problem is `ofMatrix4x4::decompose()` returns incorrect scale values for other two axes if only one was negated.\r\n\r\nRepro code:\r\n\r\n```\r\nvoid ofApp::setup()\r\n{\r\n  ofMatrix4x4 m;\r\n  m.scale(ofVec3f(1,1,-1));\r\n  cout << \"Matrix (correct scale): \\n\" << m << endl;\r\n\r\n  ofVec3f t;\r\n  ofQuaternion r;\r\n  ofVec3f s;\r\n  ofQuaternion so;\r\n\r\n  m.decompose(t, r, s, so);\r\n\r\n  cout << \"Decomposed scale (incorrect): \\n\" << s << endl;\r\n}\r\n```\r\n\r\nOutput:\r\n\r\n```\r\nMatrix (correct scale values): \r\n       1,        0,       -0,        0\r\n       0,        1,       -0,        0\r\n       0,        0,       -1,        0\r\n       0,        0,       -0,        1\r\nDecomposed scale (incorrect): \r\n-1, -1, -1\r\n```"},"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/comments/137237654","html_url":"https://github.com/openframeworks/openFrameworks/issues/4317#issuecomment-137237654","issue_url":"https://api.github.com/repos/openframeworks/openFrameworks/issues/4317","id":137237654,"user":{"login":"kylemcdonald","id":157106,"avatar_url":"https://avatars.githubusercontent.com/u/157106?v=3","gravatar_id":"","url":"https://api.github.com/users/kylemcdonald","html_url":"https://github.com/kylemcdonald","followers_url":"https://api.github.com/users/kylemcdonald/followers","following_url":"https://api.github.com/users/kylemcdonald/following{/other_user}","gists_url":"https://api.github.com/users/kylemcdonald/gists{/gist_id}","starred_url":"https://api.github.com/users/kylemcdonald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylemcdonald/subscriptions","organizations_url":"https://api.github.com/users/kylemcdonald/orgs","repos_url":"https://api.github.com/users/kylemcdonald/repos","events_url":"https://api.github.com/users/kylemcdonald/events{/privacy}","received_events_url":"https://api.github.com/users/kylemcdonald/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T20:38:58Z","updated_at":"2015-09-02T20:38:58Z","body":"that said, i bet @tgfrerer or @kpasko might have some insight here."}}