If you want to render stuff relative to the eye in float space using doubles, you:
1. Use doubles for your position vectors.
2. Use the double vector for every object position, and for your camera.
Then you have to translate your positions into a float-capable space for rendering. You translate every object position to get the position relative to the eye with:
DoubleVector3 objectPosition = object.somePosition;
DoubleVector3 cameraPosition = camera.position;
DoubleVector3 doubleRelativePosition = objectPosition - cameraPosition;
// When you translate the object by the camera position, the resulting number is representable by a float.
// Just cast the double-vector components down to floats!
relativePosition.x = (float)doubleRelativePosition.x;
relativePosition.y = (float)doubleRelativePosition.y;
relativePosition.z = (float)doubleRelativePosition.z;
and then that's the position you pass into the shader for rendering.
This is really cumbersome for a ton of objects because you have to recompute this translation every time you move your camera. There is an extension of this method to keep you from creating relative coordinates every frame. You have to create a relative anchor point that moves with your camera. To do this you have to:
1. Create a double-vector anchor point that moves with your camera periodically. You move this anchor point when float-precision starts to become insufficient to represent points inside the float-anchor-area.
2. You build relative float-vector positions for everything relative to the anchor point, as we did before with the camera but with the anchor point.
3. When you move far enough away from the anchor, you re-locate it.
4. When the anchor moves you re-translate everything relative to the new anchor point. This means everything has a double-vector world position and a float-vector relative anchor position.
5. You use a regular camera view matrix to move around inside this anchor float space.
6. Draw everything normally as if the anchor-relative position is the position, and the anchor relative camera position is the camera location.
I hope this helps!
Edited by DementedCarrot, 16 April 2014 - 09:47 PM.