Jump to content
  • Advertisement
Sign in to follow this  

calculate pitch and roll from vector

This topic is 1817 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 all,


I'm working on a simple plane sim that can only roll and pitch. It cannot yaw. There is no inertia or slippage so that all velocity is in the x direction in the body frame (y being to my right, z is my down) like this. Say I'm given a second vector that I want to try and align myself with. If the vector is in the +- z direction, I can pitch to get there. But if there is any y component to the vector (in my body frame), then I will have to do some combination of roll and pitch to get there. For example, if it's in my x-y plane but directly to my left, I'll have to roll by -pi/2, then pitch until I'm aligned. Or I could start pitching while rolling. It seems to me like there would be multiple ways to achieve the same action.

Is there a standard way to compute this sort of thing? I've seen a good number of examples where yaw is not constrained, in which case you can do something like yaw=atan2(-vel.y, vel.x);  Any idea for the yaw-constrained case?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!