Skip to main content
gamedev.net
🔒 Locked

Angle between two objects (3d)

Started by Sfpiano 1 reply 850+ views
Original Post
Sfpiano
Sfpiano
O-----Z | | |--|a | X How, in 3D, would you calculate angle 'a' between X and Z?
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
alvaro
alvaro
Take the scalar product of the two vectors, divide by the lengths of both vectors, take the arccosine.

Actually, this is pretty much a definition of angle.
adam17
adam17
Quote:
Original post by alvaro
Take the scalar product of the two vectors, divide by the lengths of both vectors, take the arccosine.

Actually, this is pretty much a definition of angle.


ie the Dot Product

angle = acos((U.V)/(Magnitude(U)*Magnitude(V)))

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.