My element has been 3D transformed in the following way:
.foo {
transform: rotateX(-30deg) rotateY(35deg);
}
Now, I am looking to retrieve these values using JavaScript. Extracting the 3D matrix is simple:
var matrix = $('.foo').css('transform');
// returns:
// matrix3d(0.819152, -0.286788, -0.496732, 0, 0, 0.866025, -0.5, 0, 0.573576, 0.409576, 0.709406, 0, 0, 0, 0, 1)
The challenge lies in calculating CSS values like -30 and 35 from that matrix. While methods exist for 2D transforms, a solution for 3D rotation remains elusive.