Android的 - 得到一个矩阵的当前旋转 [英] Android - getting the current rotation of a matrix

查看:451
本文介绍了Android的 - 得到一个矩阵的当前旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够设置一个矩阵的旋转,而不是添加到它。我相信,以设置旋转的唯一方法是知道的矩阵的当前旋转

I need to be able to set the rotation of a matrix rather than add to it. I believe the only way to set the rotation is to know the current rotation of the matrix.

注: matrix.setRotate()不会做,因为矩阵需要保留其信息

Note: matrix.setRotate() will not do, because the matrix needs to retain its information.

推荐答案

你可以做的就是调用的GetValues​​ 和缓存的数值。当你想他们回来就叫 setValues​​方法在矩阵以后。

What you can do is call getValues and cache the values. Later when you want them back just call setValues on the matrix.

旋转矩阵与变换矩阵关系很好的解释这里

The rotation matrix and transform matrix relation well explained here

这篇关于Android的 - 得到一个矩阵的当前旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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