CSS3转换的Matrix3D值 [英] css3 converting matrix3d values

查看:635
本文介绍了CSS3转换的Matrix3D值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何得到的Matrix3D的rotateX和rotateY值,像这样的:

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, 0, 0.9999999970415847, 0, 0, 0, 300, 1)

没有任何人知道如何呢?我真的AP preciate的帮助特别是因为我不是真正的人的数学类型。日Thnx!

does anybody know how to this ? I would really appreciate the help especially since I am not really the math type of person. thnx!

推荐答案

我不擅长数学要么,所以这需要一些检查由拥有更多的知识比我:

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

var matrix = new WebKitCSSMatrix(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/

这篇关于CSS3转换的Matrix3D值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆