Skip to content Skip to sidebar Skip to footer

Css3 Converting Matrix3d Values

I want to know how to get the rotateX and rotateY values of a matrix3d such as this: matrix3d(0.9999999970415847, 0, 0.00007692093651178932, 0, 0, 1, 0, 0, -0.00007692093651178932,

Solution 1:

I'm not good at math either, so this needs some checking by someone with more knowledge than me:

var matrix = newWebKitCSSMatrix(el.style.webkitTransform);
var rotationX = Math.acos(matrix.a) * (180/pi);
var rotationY = Math.asin(matrix.b) * (180/pi);

You can view a demo here:

http://jsfiddle.net/YsCF5/

Post a Comment for "Css3 Converting Matrix3d Values"