I am needing to get the current camera angle so am using the current direction as a Cartesian3 and checking its angleBetween back to (0, 0, 0).
oldBearing = Cesium.Cartesian3.angleBetween(viewer.scene.camera.direction, Cesium.Cartesian3.ZERO);
The formula works fine for any Cartesian3 (right) that is not (0, 0, 0) but the result is NaN using ZERO.
Please advise with thanks.
hannah
August 29, 2016, 2:38pm
2
Hello,
There is no angle between a vector and the zero vector because the zero vector is the origin.
Are you trying to get the camera heading? In that case, you can just do ‘var heading = camera.heading’
Best,
Hannah
Thanks Hannah. I was just wanting to get the actual angle in degrees of the (x,y) coordinates from .direction the lazy way (without using trigonometry formulae, so with your confirmation I can continue in that way. Charlie
hannah
August 30, 2016, 2:32pm
4
The angle between what and what? I’m sorry, I don’t understand. What is your end goal?
-Hannah