简体   繁体   English

如何绕对象自身的轴旋转?

[英]How to Rotate an object about its own axis?

I'm having a problem working out how to solve a problem. 我在解决如何解决问题时遇到问题。

My problem involves getting the 3D representation of an objects angle, and then applying a rotation to that object on it's own axis. 我的问题涉及获取对象角度的3D表示,然后在该对象自身轴上对该对象施加旋转。

For example, an aircraft with: 例如,具有以下特征的飞机:

  • Heading 45 (North East) 标题45(东北)
  • Pitch 45 (Nose Up) 音高45(鼻子向上)
  • Bank 45 (Banked Left) 银行45(左岸)

That is rotated across it's own yaw axis through -90 degrees should then be roughly: 它将绕其自身的偏航轴旋转-90度,然后大致旋转:

  • Heading ~-9.8 (North by North North West) 约〜-9.8(北向西北)
  • Pitch -30 (Nose Down) 俯仰-30(下鼻)
  • Bank 54.5 (Banked Left) 银行54.5(左岸)

(As calculated purely off guesstimation using another program to make the aircraft a child of itself and rotate through 90 degrees, then trying to match the orientation...) (根据使用另一个程序使飞机完全成为自己的孩子并旋转90度,然后尝试匹配方向的纯估计值而计算出来的……)

Can anyone explain how this sort of rotation is calculated? 谁能解释这种旋转的计算方式? or even point me into the right path as to learning how? 甚至为我指出学习方法的正确路径?

I have tried applying a basic rotation matrix to the angles (as to be used for rotating points about an origin), but it only rotates relative to the base x/y/z axes and not that of the aircraft (so results from above would be (-45,45,45) 我尝试将基本旋转矩阵应用于角度(用于绕原点旋转点),但它仅相对于基本x / y / z轴旋转,而不相对于飞机的旋转(因此,从上方得出的结果会是(-45,45,45)

For mathematics purposes, the rotation does not concern point co-ordinates, only the 3 representation angles. 出于数学目的,旋转不涉及点坐标,仅涉及3个表示角度。

I would prefer not to use any external libraries. 我宁愿不使用任何外部库。

Though irrelevant, this will be for a C# application. 尽管无关紧要,但这将适用于C#应用程序。

Thank you all very much for your help and insight! 非常感谢您的帮助和见解!

The rotation matrix is a good start, but you'll need a Translation matrix as well to get the origin right. 旋转矩阵是一个不错的开始,但是您还需要一个平移矩阵才能正确确定原点。

You'll need linear algebra with rotation matrices if you want to do it by hand. 如果您想手工制作,则需要带有旋转矩阵的线性代数。 It require some mathematics skills. 它需要一些数学技能。

Basically this (below) states: move the object to the origin of x/y/z/, apply the rotation matrix and put it back at the original position. 基本上,该状态(如下)指出:将对象移动到x / y / z /的原点,应用旋转矩阵并将其放回到原始位置。

I must warn you, it's hard to get it right by hand. 我必须警告您,很难手动解决。

http://en.wikipedia.org/wiki/Translation_%28geometry%29 http://en.wikipedia.org/wiki/Translation_%28geometry%29

http://en.wikipedia.org/wiki/Rotation_matrix http://en.wikipedia.org/wiki/Rotation_matrix

As a acquaintance of mine put it once: 我的一个熟人曾经说过:

r'j(t) = r'0(t) + Ω(t) x [rj(t) - r0(t)] r'j(t)= r'0(t)+Ω(t)x [rj(t)-r0(t)]

http://en.wikipedia.org/wiki/Euler%27s_rotation_theorem http://en.wikipedia.org/wiki/Euler%27s_rotation_theorem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM