Jump to content
  • Advertisement
Sign in to follow this  
symbiote

flight sim rotation order

This topic is 3317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi Guys, i'm making simulation that needs rotations i thought about the typical rotations present in flight sims ( yaw, pitch, roll ). these rotations are done to the aircraft's frame of reference. but when the same rotations are combined in different orders there are different autcomes. my question is: what is the order that these rotations are done in and especially why. symbiote

Share this post


Link to post
Share on other sites
Advertisement
I strongly suggest - don't work in roll/pitch/yaw. Store everything as rotation matrices or quaternions, and do all your calculations based on these. If you need to extract roll/pitch/yaw (e.g. for debugging or GUI stuff) then that's easy enough later.

Share this post


Link to post
Share on other sites
if i store it in matrices / quarternions doesn't it still need to be put in them in a specific order?

Share this post


Link to post
Share on other sites
1) Pick and order and stick with it. It doesn't really matter what order you do them in.
2) The reason it doesn't matter is that you don't want to be storing "yaw 90, pitch 25, roll 45". You want to store a quaternion or rotation matrix that represents the current orientation of your plane. You then update the current rotation incrementally per frame ( orientation.RotateLocalYaw( rotspeed * dt ) ). Since you do everything incrementally with small values, you never risk getting into the situation where you gimble lock (caused by rotation order mattering if you end up rotating one axis onto another). And thusly, order doesn't matter.
3) If you need the current yaw/pitch/roll for some indicator, just decompose the matrix for the values.

Share this post


Link to post
Share on other sites
The multiplication of rotation matrices (so as quaternions) do not commute in general. When you multiply (or "combine" in your words) a number of rotation matrices in different order, you have a different rotation in general. I don't think there is any room for discussion about it.

For Euler Angles, there are a lot of different definition about the axis and their ordering. The following link shows some of them.

http://www.euclideanspace.com/maths/geometry/rotations/euler/index.htm

Amount those definitions, there is no good reason why a particular one is better than the others numerically. In general, we need three axis to define Euler Angle. However, the criterion of these axis is very loose indeed. As long as the consecutive axis are not parallel to each other (NOT EVEN orthogonal), they can be used. That's why we have some funny definition like {z,y,z}.

As mentioned earlier, no one is particularly better than the others numerically. So, when you decide using which definition, any one of them is just fine as long as you using it consistently. However, you are trying to implement a flight sim, right? So, you probably want to follow the definition of the real world gimbals device.

[Edited by - ma_hty on May 18, 2009 5:34:12 AM]

Share this post


Link to post
Share on other sites
i'm playing with ODE it's all very basic and it won't be a flight sim. but i was wondering how flexible the rotations are that it offers compared to those that would be needed in flight sims.
it keeps track of a rotation/orientation matrix so i started wondering. i guess i could have it create a matrices for the rotations i want and apply the orientation matrix to them to produce a new orientation matrix.
thanks for the info.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!