Jump to content
  • Advertisement


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


Quaternion Orientation

This topic is 5232 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, Having a problem getting a grip on Quaternion rotations in the 3D engine I am using (Axiom). Most of the examples I see on the net talk about adding arbitrary amounts of rotation to a 3D object''s quat to rotate it. In my case, I need to achieve a specific orientation. Basically, heres what I am trying to do. I am working on a Spaceship Combat Sim (Capital Ships), and I am trying to have the ships rotate to face their enemy. All the ships have a ton of information available including Position Vector (relative to origin), and Quaternion orientation. They also contain positional data as Matrixes, but I was thinking that manipulating the Quaternion would be less expensive from a performance standpoint. However two problems arise: 1) I can only get the ship to orient when its at the origin properly. 2) Even at the origin, the ship rolls on it''s side as it orients past 90 degrees. Given that you know Your Position (3part vector), your Orientation (Quat) and the Enemy Position (another Vector3), how do you come up with a Quaternion to desctibe the new orientation? If I know this, the engine already has functionality in it to smoothly rotate from one Quat to another Quat. PS, there is also a "Direction Vector" available on all 3D objects if this is helpful. Thanks for reading.

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!