NOTE:
getComputedStyle method only work's for elements which are appended to your document
let's start with a function that make's a hidden element and append's it into your document :
var make_test_el =
function () {
var el = document.createElement("div");
// some browsers doesn't add transform styles if display is inline
el.style.display = "block";
// to be sure your element won't be shown
el.style.width = "0px";
el.style.height = "0px";
el.style.margin = "0px";
el.style.padding = "0px";
el.style.overflow = "hidden";
document.body.appendChild(el);
return el;
}
then just use it by the following code:
var value = 'rotateX(10deg) rotateZ(10deg)'; // your readable value for transformation
var elem = make_test_el();
elem.style.transform = value;
// take your result and alert it
var result = window.getComputedStyle(elem,null).transform;
alert(result);
//then remove appended element
elem.parentNode.removeChild(elem);
demo : http://jsfiddle.net/hbh7ypc9/1/
the result that you'll see maybe matrix3d(...) or matrix(...)
It depend's on browser's RenderEngine and the given value
for example:
IE10 will always give you matrix3d(...)
but for chrome and opera depend's on given value
but I've no idea about converting a 2D matrix to a 3D one
that's a question I've too
actually matrix values are really hard to understand
good luck...