Jump to content
  • Advertisement


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


Finding a quaternion rotation angle ?

This topic is 5461 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, I am trying to rotate a model to always face towards a point in world space, no matter where about it is positioned itself. To do this, I need to work out the axis vector and angle values to use with the D3DXQuaternionRotationAxis function. This is the part i'm really struggling on, can anyone help ? Jase [edited by - Jase_S on November 9, 2003 10:14:19 AM]

Share this post

Link to post
Share on other sites
I finally managed to sort it, I don''t fully understand what i''ve done, but it works, so will leave it at that for now.

If anyone else struggles with the same problem, the solution that worked for me is below :

void q_rot_to(D3DXVECTOR3 *p1,D3DXVECTOR3 *p2,D3DXQUATERNION *q)
D3DXVECTOR3 dif,v,axis;
float angle;



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!