Matrix转rotation
来源:互联网 发布:淘宝虚拟物品类目选择 编辑:程序博客网 时间:2024/06/16 10:12
Matrix可以控制显示对象的平移(x 和 y 重新定位)、旋转、缩放和倾斜:
var m:Matrix = new Matrix(scaleX, rotateSkew0, rotateSkew1, scaleY, translateX, translateY);
DisplayObject.transform.matrix = m;
这种写法在Flash中很方便,在其他框架下可能不支持transform或者matrix的方式去设置,因此需要从matrix里转换到旋转角度等。
看下带旋转和缩放后的Matrix数据。
位移是可以从matrix直接获得的,缩放和旋转都需要重新计算:
var px:Point = matrix.deltaTransformPoint(new Point(0, 1));
rotation = ((180 / Math.PI) * Math.atan2(px.y, px.x) - 90);if(rotation < 0) { rotation = 360 + rotation; }
xscale = Math.sqrt(scaleX * scaleX + rotateSkew0 * rotateSkew0);
yscale = Math.sqrt(rotateSkew1 * rotateSkew1 + scaleY * scaleY);
0 0
- Matrix转rotation
- Rotation Matrix
- HackerRank [Algo] Matrix Rotation
- 根据Matrix获取Rotation
- Rotation Matrix To Euler Angles
- Rodrigues' Rotation Matrix(罗德里格旋转矩阵)
- The Mathematics of the 3D Rotation Matrix
- Get translation and rotation matrix of an object
- To get the View matrix from the rotation,translation,scale
- Computing Euler angles from a rotation matrix (翻译)
- AS3基础:图片绕中心点旋转(Matrix) 与直接rotation不会发虚
- 【转】JPEG Rotation and EXIF Orientation
- Android rotation 转屏过程分析
- Android rotation 转屏过程分析
- Android rotation 转屏过程分析
- Android rotation 转屏过程分析
- Rotation transformation
- 2.rotation
- 数据结构:题目(3)测试一个数组序列是否是二叉树的前序遍历或者后序遍历结果
- java获取字符串格式日期向前或向后n天的日期
- JAVA实现SFTP实例
- 百度2015实习生招聘笔试
- Intent进阶 和 Intent-filter 学习笔记
- Matrix转rotation
- android为activity设置自定义风格title
- 黑马程序员--IOS学习日记:01--OC概述
- AndroidManifest.xml uses-feature 详解
- 小胖的疑惑 【整数划分 区间DP】
- mybatis错误: Invalid bound statement (not found) ——原因之一
- NFC写Uri进Tag,与识别Tag
- 703n路由器 刷openwrt 修改 串口双向传输和串口波特率
- 12-tika索引的创建和搜索