I don’t understand why when I translate something very far (like to an X of 100,000) the object being drawn snaps around while moving instead of being smooth. I figured it was because I was using floats (only had a couple decimal points of precision at that distance), but when I started using glTranslated the result was the same.
The object being drawn has vertices defined by floats, but I figure that shouldn’t matter because the object itself is very small. Does gltranslate add an offset to all of the vertices or something? If that’s true, then making the object use double precision vertices should fix the problem right?
I figured it was because I was using floats (only had a couple decimal points of precision at that distance), but when I started using glTranslated the result was the same.
I wouldn’t expect the "double` versions of the matrix functions to actually use doubles internally. They probably just cast them to floats.
You need to use doubles to generate your ModelView matrix manually (ie: not with OpenGL functions), then convert that matrix back to floats when you hand it to OpenGL (via glLoadMatrix). That way, your large translation from model-to-world will cancel out with your equally large but negative world-to-camera translation.
@Alfonse: Thanks, that did the trick!
@Overaly: Also thanks, I’ll check those out.