I striped my render code down to the basics in an effort to identify the issue:
[source lang="cpp"]Camera CalculationsCameraTarget.X = CameraPosition.X + Sin(vRadians)CameraTarget.Y = CameraPosition.Y + (Cos(vRadians) * Cos(hRadians))CameraTarget.Z = CameraPosition.Z + (Cos(vRadians) * Sin(hRadians))CameraUp.X = 0;CameraUp.Y = 1;CameraUp.Z = 0;Update View Matrix:D3DXMatrixLookAtLH(View_Matrix, CameraPosition, CameraTarget, CameraUp);[/source]
To make things as simple as possible I’ll add 0.002 to the hRadians float each frame. This makes the camera rotate to the left but when I slow the frame rate down I can clearly see the camera is not turning the same amount each frame. This also happens when I calculate rotations for the world matrix before rendering 3D objects too. When rendering at 60 FPS and adding an easing calculation to movements it’s not as noticeable for moving forward, backwards, left and right but when rotating, it is very noticeable. Even with the easing code added you can tell the rotations are accelerating and decelerating, sometimes jerky.
I’ve tried to truncate the calculations for the CameraTarget and CameraPosition to regain some precision but to no avail, the issue still persists.
Is this a precision issue? And if so, how can I get more precision for rotations? If it’s a not a precision problem then what is it?
Edited by DJTN, 17 November 2012 - 01:43 PM.