Sign in to follow this  

Vector to Degree calculation

This topic is 4075 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 how to calculate a vector from a degree. I couldn't find any resources online or in my books on how to calculate a vector to a degree which makes me think it's something really easy I'm just not thinking about. I have a heading vector. Its values are x = 1, y = 0, z = 0. I need my model to face towards its heading. I'm using Irrlicht so it uses degrees to specify rotations. How would I convert my heading vector to a degree so the model displays correctly? (Please note that the heading can change to any normal vector) The model by default faces this way: ---> The heading moves the model this way: ^ | | | The camera is high up in the world on the Y axis. Any ideas?

Share this post


Link to post
Share on other sites
The dot and cross products can be used to detemine angles. If your 0 degree heading is z, and your facing is a, then:

z * a = |z||a|cos T
|z X a| = |z||a| sin T

Share this post


Link to post
Share on other sites
Quote:
Original post by erissian
The dot and cross products can be used to detemine angles. If your 0 degree heading is z, and your facing is a, then:

z * a = |z||a|cos T
|z X a| = |z||a| sin T


Continuing on with that, use the dot product to find the angle between the two vectors and the cross product to find the axis of rotation.

Share this post


Link to post
Share on other sites

This topic is 4075 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this