Everything's fine but the camera is "jumping" and when there are more more than one objects on the screen and they get a bit far away they sometimes star disappearing and reappearing (flashing) very fast.
Even with only one object in the game, when the camera should be at the same (x, z) position as the object, it is jerky.
Here's the code I use every frame to position the camera:
Code: Select all
projection.buildProjectionMatrixOrthoLH(w, h, 20, -5);
g_camera->setProjectionMatrix(projection);
g_camera->setPosition(vector3df(x, 1, z));
g_camera->setTarget(vector3df(x, 0, z));
g_camera->setUpVector(vector3df(0, 0, 1));
Immediately following this code is a beginScene(), drawAll(), endScene() sequence.
I'm putting it on my FTP server (less than 600KB): ftp://studio4plus.com/pub/test2.zip (it doesn't work too well with MSIE I'm afraid). See the README.txt file.
And, well, the question is, what can I make to eliminate this jerkyness?
I'm planning to be moving the camera with inertia in the long run, maybe that'll be enough to smooth it out?
I haven't completely figured out the zNear, zFar parameters yet (I think I know what they're for, but my understanding of them isn't correct I'm afraid) but I don't think it has much to do with them.