Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Mapping user input to object rotation without order/gimbol prob

This topic is 6293 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

I know this has been addressed before but the past posts seem to be geared toward cameras. So here is exactly what I would like to do and the problem I am having. Any help would be GREATLY appreciated. I am attempting to apply user control to a spaceship. I am having the well discussed problem of gimbol lock. I want a user to be able to rotate the ship using pitch, roll, and yaw. When the user pitches up, the rotation needs to be in relation to the ship. I understand the problem of rotation order. I have tried to use Quaternions but of course when I convert from pitch, roll, yaw to the quat, I get the same effects. How do you map user input to a Quaternion? Or, how do I map the current pitch, roll, and yaw of the ship to the model in a way that allows each axis to relate to it''s peer on the model, effectivly applying xyz rotation simultainiously from an origin. It is important to my applicaiton to know the exact rotation of the model at all times so simply appying rotations continuosly to a matrix doesn''t work well for that. I hope you understand what I am asking. I need to map that user input to the object. Thanks

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Well, I might be wrong, but the problem of the gimbal lock is that an object is rotated, but not it''s coordinate frame, so a rotated axis could map onto another axis of the static coordinate system ?
The solution would be to rotate the local coordinate system of the object.
What about maintaining 3 quaternions representing the 3 axes of rotation (x,y,z) of the object. Now, if you want to rotate around, say x, don''t rotate about the actual x-axis, but around the axis represented by the x-quaternion. Update your model with the rotation, aswell as the other two quats. This should avoid the gimbal lock ? And there is surely a simpler solution to this problem

Share this post

Link to post
Share on other sites

  • 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!