This question was
closed Dec 28, 2015 at 05:59 PM by
gabenator123 for the following reason:
The question is answered, right answer was accepted
Question by
gabenator123 · Dec 26, 2015 at 07:40 PM ·
rotationchangeeulerangles360-degreesdelta
Get accurate Change in EulerAngles?
I am trying to get the change in object rotation by subtracting the rotation eulerangles of the last frame from those of the current frame. It almost works perfectly, however because they go from 359 to 0, the value that results from the subtraction is inaccurate. from 359 to 361 is -358, not +2. How can I fix this?
Comment
How are you subtracting? Can I see that code or just the line you use? By the looks of it, you should just invert it.
basically~~
(update())
xCurFrame = camera.x
deltaX = xCurFrame - xLastFrame
xLastFrame = xCurFrame
repeat.
Try not to compare Euler angles, you will always have this problem, use ins$$anonymous$$d Quaternion.Angle.
The code you wrote looks like an approximation, I cannot see the angles there. If you copy and paste your code we could help you better.