为什么四元数有四个变量? [英] Why do Quaternions have four variables?

查看:34
本文介绍了为什么四元数有四个变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Unity 引擎的官方文档不包含此内容,而且我的数学/物理研究还不够深入,无法遇到四元数,但我知道它与旋转有关.我不明白的是,当 Unity 中只有三个旋转轴时,为什么四元数有四个变量 w、x、y、z.

The official documentation for the Unity Engine doesn't contain this, and I'm not far enough into my math/physics studies to have come across a Quaternion, but I understand it has to do with rotation. What I don't understand is why Quaternions have four variables, w,x,y,z, when there are only three axis of rotation in Unity.

推荐答案

"四元数基本上是 3D 空间中的一个轴,围绕该轴旋转一个角度.四个值组成了一个四元数,即 x、y、z 和w. 其中三个值用于以矢量格式表示轴,第四个值将是绕轴旋转的角度."

"A quaternion is basically an axis in 3D space with a angle of rotation around the axis. Four values make up a quaternion, namely x, y, z and w. Three of the values are used to represent the axis in vector format, and the forth value would be the angle of rotation around the axis."

http://www.real3dtutorials.com/tut00011.php

所以你可以把它理解为旋转的旋转,简单来说!

So you could think of it as the rotation of the rotation, in simple terms!

就像在下面的评论中提到的 Hellium 一样;Unity 建议您不要在不确切知道自己在做什么的情况下直接摆弄四元数.就像 Hellium 还指出的那样,无论您想完成什么,您可能都想使用 的静态方法四元数类.它们非常有用且易于使用,并且可以通过旋转完成大多数您想做的事情.

Like Hellium noted in the comments below; Unity recommends that you do not fiddle with Quaternions directly if don't know exactly what you're doing. Like Hellium also points out, whatever you want to accomplish, you probably want to use the static methods of the Quaternion class. They are very useful and easy to use and can accomplish most things you want to do with rotations.

这篇关于为什么四元数有四个变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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