什么是四元数旋转?
四元数旋转只是一个带有 X、Y、Z 的向量(物体将朝着该方向旋转),以及使物体绕其轴旋转的滚动吗?
真有这么简单吗?
这意味着如果 X=0、Z=0 且 Y=1,则对象将面朝上?
如果 Y=0、Z=0 和 X=1,物体会面向右侧吗?
(假设 X 向右,Y 向上,Z 深度)
Is quaternion rotation just a vector with X,Y,Z which the object will rotate towards, and a roll which turns the object on its axis?
Is it that simple?
Meaning if you have X=0, Z=0 and Y=1 the object will face upwards?
And if you have Y=0, Z=0 and X=1 the object will face to the right?
(assuming X right, Y up and Z depth)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
四元数有 4 个分量,它们可以与角度 θ 和轴向量 n 相关。旋转将使物体绕轴n旋转角度θ。
例如,如果我们有一个像这样的立方体
,那么绕轴 (x=0, y=0, z=1) 旋转 90° 会将“5”面从左侧旋转到前面。
(注:这是旋转的轴/角度描述,这就是OP混淆的地方。四元数如何应用于旋转,请参见http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation)
A quaternion has 4 components, which can be related to an angle θ and an axis vector n. The rotation will make the object rotate about the axis n by an angle θ.
For example, if we have an cube like
Then a rotation of 90° about the axis (x=0, y=0, z=1) will rotate the "5" face from the left to the front.
(Note: This is the axis/angle description of rotation, which is what OP confuses. For how quaternion is applied to rotation, see http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation)
一般来说,四元数是将复数扩展到 4 个维度。所以不,它们不仅仅是 x、y、z 和一个角度,而且它们很接近。更多内容如下...
四元数可用于表示旋转,因此它们对于图形很有用:
那么这 4 个组件是什么以及它们与旋转有何关系?
那么回到你的问题,
不...对象将围绕此
<0,1,0>
向量旋转,即它将围绕 y 轴旋转,从上面看逆时针旋转,如果您的图形系统使用右-手旋转。 (如果我们代入 w = sqrt(1 - (0 + 1 + 0)),你的单位四元数是 (0,0,1,0),它将旋转角度 2 cos-10, = 2 * 90 度 = 180 度或 pi 弧度。)这将围绕向量
<1,0,0>
(x 轴)旋转,因此从正 x 方向(例如向右)看,它将逆时针旋转。因此顶部会向前转动(180 度,因此它会旋转直到面朝下)。A quaternion in general is an extension of a complex number into 4 dimensions. So no, they are not just x, y, and z, and an angle, but they're close. More below...
Quaternions can be used to represent rotation, so they're useful for graphics:
So what are the 4 components and how do they relate to the rotation?
So back to your question,
No... the object will rotate around this
<0,1,0>
vector, i.e. it will rotate around the y axis, turning counterclockwise as seen from above, if your graphics system uses right-hand rotation. (And if we plug in w = sqrt(1 - (0 + 1 + 0)), your unit quaternion is (0,0,1,0), and it will rotate by angle 2 cos-10, = 2 * 90 degrees = 180 degrees or pi radians.)This will rotate around the vector
<1,0,0>
, the x axis, so it will rotate counterclockwise as seen from the positive x direction (e.g. right). So the top would turn forward (180 degrees, so it would rotate until it faced downward).