I'm working with a 3D that has a property of type Vector3D called FrontDirection. This object is rotated as follows:
var rotate = new AxisAngleRotation3D(new Vector3D(0, 1, 0), deltaAngleInDegrees);
var transform = new RotateTransform3D(rotate);
my3DObject.FrontDirection = transform.Transform(my3DObject.FrontDirection);
After some arbitrary amount of rotation, I'd like to determine the angle of the object as viewed from above. I'd expect the value to vary between [0, 360). The closest I can get is the following:
var angle = Vector3D.AngleBetween(new Vector3D(1, 0, 1), my3DObject.FrontDirection);
However, while rotating the object in a complete circle the angle varies 0 to 180, then falls back down to 0. It seems like AngleBetween is giving the distance between the vectors without considering direction. What's a good way to calculate the angle?