计算具有旋转前位置和旋转角度的点的绝对位置 [英] Calculate the absolute position of the point having the position before rotation and rotation angles

查看:133
本文介绍了计算具有旋转前位置和旋转角度的点的绝对位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将点(x, y, z)绕各自的轴旋转角度(rx, ry, rz)?

How can I rotate the point (x, y, z) by angles (rx, ry, rz) about their respective axes?

也就是说,如何确定由于旋转角度(rx, ry, rz)旋转(x, y, z)而产生的点(x1, y1, z1)?

That is, how do I determine the point (x1, y1, z1) resulting from the rotation of (x, y, z) by rotation angles (rx, ry, rz)?

是否有任何DirectX例程可以做到这一点?

Are there any DirectX routines which accomplish this?

推荐答案

您要问的是如何使用

What you are asking about is how to use Euler Angles for performing rotations. There are several conventions you can choose from, but it looks to me like you are interested in applying rotation about the Z axis, followed by rotation about Y and then rotation about X. For this you would post multiply by the matrix

其中

c1 = cos(rx)    s1 = sin(rx)
c2 = cos(ry)    s2 = sin(ry)
cs = cos(rz)    s3 = sin(rz)

此方法存在多个问题,其中最常见的问题之一是万向节锁.优选的方法是使用角度轴公式之一.其中最常见的两个是单元四元数旋转

There are several problems with this approach, one of the more common being gimbal lock. The preferred approach is to use one of the angle-axis formulations. The two most common of those are Unit Quaternion Rotations and Euler-Rodreigues Rotation Matrices. These can be composed to generate any of the 12 Euler Rotation matrices by explicitly defining three rotation axes and their associated rotation angles and then multiplying the resulting rotation representation in the reverse order they are to be applied to the vectors to be rotated.

DirectX使用四元数用于执行旋转.

DirectX uses Quaternions for performing rotations.

这篇关于计算具有旋转前位置和旋转角度的点的绝对位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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