Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8438897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:50:54+00:00 2026-06-10T07:50:54+00:00

The problem that I am having is as follows. When I rotate my spaceship

  • 0

The problem that I am having is as follows.
When I rotate my spaceship up (pitch) and rotate it at a full 90 degrees in the pitch, it stands up straight, and then try to rotate it again on the y-axis the model now rotates in the same fashion as a roll in the starting position.

Now my question, how can I fix this? How can I make sure my model always rolls when I want it to roll, always pitch when I want it to pitch, etc. Instead of what it does now.

I’m using c++ and opengl.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:50:56+00:00Added an answer on June 10, 2026 at 7:50 am

    As has been pointed out already, you’re seeing Gimbal Lock as a result of the way you’re using Euler angles to perform rotations.

    Quaternions are not the only solution, however. You can instead construct a 4×4 matrix to represent an object’s current orientation, and apply relative rotations to it each time you change facing. It isn’t perfect, as you need to keep track of 16 values per object instead of 4 for a quaternion, and in order to deal with floating point rounding errors you’ll need to periodically normalise things so your orientation matrix doesn’t become a skew transform. On the other hand, it is conceptually simple and pretty quick to put together.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I having a problem when rotate the bitmap. My requirement is as follows, Capture
I'm having the weird problem that after having javascript inject some dom-elements the css-rules
I am having problem that when i am trying to submit the form by
I've been thinking/searching for an equivalent of the problem that I am having below,
HI Guys, Here I am having problem that How can I post an image
Taking a rails tutorial, and I've run into the following problem that I'm having
Dear Friends from Stackoverflow, Please help me with a problem that i'm having when
I'm having a problem that only seems to happen on my Lenovo Thinkpad Tablet
I am having a problem that just started happening in OS 3.1. I have
I'm having a problem that a statusbar get displayed over the content of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.