Calculating the angle of rotation
Posted: Wed Aug 02, 2017 1:37 pm
I know this is a simple calculation but having a brain freeze here I have an object which is moving around and at any given point I want to find the rotation angle of it I have tried getting the forward vector x and z and doing the following and its giving me strange results
var angler = MathHelper.ToRadians((float)(Math.Atan2(Board.WorldTransform.Forward.Z, Board.WorldTransform.Forward.X) * 180.0 / Math.PI))
What am I doing wrong
var angler = MathHelper.ToRadians((float)(Math.Atan2(Board.WorldTransform.Forward.Z, Board.WorldTransform.Forward.X) * 180.0 / Math.PI))
What am I doing wrong