iOS旋转矩阵的解释 [英] explanation of iOS rotation matrix

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

问题描述

我正在尝试使用 3D 旋转,但我似乎不明白框架如何进行计算.

I am trying to work with 3D rotations but I don't seem to get the idea how the framework does the calculations.

例如我得到这个数据:

偏航 -1.010544 俯仰 0.508249 滚转 1.128918

yaw -1.010544 pitch 0.508249 roll 1.128918

然后我打印相应的旋转矩阵

Then I print the corresponding rotation matrix

  • 0.599901 -0.128495 -0.789689
  • 0.740043 0.464230 0.486649
  • 0.304065 -0.876344 0.373584

在阅读了 API 和 wiki 之后,我很确定一定有一种通用的方法可以从欧拉角创建旋转矩阵.我在这里尝试了所有这些,但没有结果.

After reading the API and the wiki, I am pretty sure there must be a general way to create a rotationmatrix out of euler angles. I tried all of these here, no results.

我是否遗漏了什么,或者这是如何完成的?

Do I miss something, or how is this done?

推荐答案

好吧,iOS 或 CoreMotion 两者都提供.RotationMatrix 和欧拉角表示.文档是 此处.

Well, iOS or CoreMotion provides both. RotationMatrix and Euler Angle Representation. The documentation is here.

但如果您对该计算的工作原理感兴趣,请查看此处.总结一下:每个欧拉角都可以用一个旋转矩阵来表示,该矩阵描述了围绕一个单位轴的旋转.由于有三个角度,您只需要将它们组合起来.但要小心!欧拉角不是明确的,因为旋转矩阵可以相乘的阶数不同.

But if you are interested how this calculation works, the take a look here. To sum it up: Each Euler Angle can be represented by a rotation matrix which describes a rotation around one unit axis. Since there are three angles, you just have to combine them. But watch out! Euler angles are not unambiguous since there are different orders in which the rotation matrices can be multiplied.

您链接到四元数计算.还是我完全错了?

You linked to a quaternion calculation. Or am I completely wrong?

这篇关于iOS旋转矩阵的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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