# Vector to Degree calculation

This topic is 4288 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 on other sites
Quote:
 Original post by erissianThe 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.

1. 1
2. 2
Rutin
23
3. 3
JoeJ
20
4. 4
5. 5

• 27
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631737
• Total Posts
3001944
×