#### Archived

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.

## 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 on other sites
http://www.euclideanspace.com/maths/algebra/vectors/lookat/index.htm

##### Share on other sites
THANKS, for the fast and useful reply. Ill give this a try immediately! Cheers!

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 17
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631758
• Total Posts
3002155
×