如何对webkit matrix3d转换进行逆向工程

Mat*_* H. 6 css webkit matrix css3 css-transforms

我有一个立方体元素在3d空间中旋转和翻译.

我想找出刚才的这个旋转Y部分变换在给定时间.这可能吗?

我有:

var cube = document.getElementById("cube");
var transform = getComputedStyle(cube).webkitTransform;

//the value of transform is:
// matrix3d(-1, 0, 0.00000000000000012246467991473532, 0, 
//           0, 1, 0, 0, 
//          -0.00000000000000012246467991473532, 0, -1, 0, 
//           0, 0, 0, 1)
Run Code Online (Sandbox Code Playgroud)

救命?:-)

Rua*_*man 4

如果您的对象仅绕 Y 旋转,那么是的,旋转很容易计算 - 它是矩阵元素 1,1或 3,3 的反正余,或 -(元素 3,1) 的 arsin 或元素 1 的 arcsin, 3. 在您的具体示例中,大约为 180 度。如果旋转不仅仅围绕 y 轴,那么您必须开始跟踪以前的旋转,并且它可能会变得更加混乱。

您的翻译将只是输出矩阵的底行,在本例中为 0,0,0。

请参阅http://www.inversereality.org/tutorials/graphics%20programming/3dwmatrices.html上的示例