Vertices shake/stutter with camera further away from origin

Hi,

When I move the camera with gltranslatef of up towards 8.000 units the objects close to the camera (0.5 or so) is moving around a few pixels in random directions when I rotate the camera (using glrotatef). I tried using gluLookAt as well but that, as expected, didn’t have any influence.

The perspective near/far planes do not influence the jittering at all. I do not see it happen when only using translate (not rotating the camera).

As it’s not happening closer to the origin I’m guessing it is a precision issue, but the numbers aren’t really high so it might just be that I’m not thinking about something. I’d really not want to rewrite the engine to support several origins…

Any ideas?

Mike

EDIT: I improved it somewhat by creating my own modelview matrix and creating the forward/side vectors based on the relative eye/center position instead of the absolute positions. The multiply of the eye position still causes issues though, so the thought that it was purely caused by rotation wasn’t correct. It seems I’ll have to do a big rewrite…

Seeing as none of the geniuses in here had a better idea I rewrote some things to support several origins :slight_smile:

My engine has been streamlined lately so it only took 2 hours or so and that solved the problem completely.

The only drawback at the moment is that the VBO’s recreate once every 4.000 meters that you run. That will will occur once every 10 minutes or so if you run in a straight line along an axis with a 100% speed horse), currently it will be once every 20 minutes or so. The reloading takes some 2-3 seconds so it’s not a horrible tradeoff and if I feel like it I could double buffer it, although I doubt it’s worth my time at the moment.

If anyone else has similar experiences and resolves it differently I’d be happy to hear about it.

Mike

I can’t say why others didn’t help, but i didn’t because I have no idea what the fluff you’re talking about. Maybe it’s because I’m tired, maybe because I’m stupid, or maybe because you’re using bad terminology (no offense), I just don’t understand your problem. Sorry.

If you don’t understand the terminology you’re welcome to ask, it is the best way to learn after all! :slight_smile:

Long story short: Watch out for glTranslates larger than a 20.000 times the distance you want the camera to be from your vertices. It can cause all kind of graphical issues.

Mike