Hi all, I'm importing my camera position and rotation from a .max export to .Babylon. And I make the camera fly from 1 camera point to the other. But in some cases the camera rotation rotates like 270 degrees to get to the end rotation. I've set up the angles in this playground. http://www.babylonjs-playground.com/#W27OD How can I calculate the difference in angle between 2 vectors and convert 1 of them to make sure that the shortest route will be taken? thanks To clarify:
You can use the Dot Product to find the shortest angle between the vectors. Let A be the vector defined by the dark blue colored arrow and let B be the vector defined by the cyan colored arrow. The Dot Product of two vectors can be calculated using any of two equations. One equation states that the Dot Product of 2 vectors is the product of the magnitude of the vectors times the cosine of the shortest angle (theta) between them, written as: A . B = ||A|| ||B|| cos(theta) The other equation