|
INFINITE
COORDINATE SYSTEM
To
understand well this feature let
me show you a post that I sent two years ago to the newsgroup:
comp.graphics.algorithms
>Title: Planet
coordinates and floating point math.....disaster!!!
>Hi to all !!!
>Let me to explain you a very hard question:
>Normally a 3d engine uses the floating point (single) math
to define a
>vertex
>in the space. With this system we limit the space
coordinates accuracy of
>the far objects. The degradation of accuracy increase with
the distance of
>the point from the zero position.
>Let me give you an example:
>I'm programming a game like the magnificent old Frontier
(Elite 2), now my
>problem is to define the planets' coordinates of the
solar system. If I
>choose the metres like unit of measurement (for a space
simulator I think
>it's the best), calculate the coordinates become a very
hard work. Infact
>Pluto is at about 6 000 000 000 km from the sun, and in
metres the value is
>6 000 000 000 000 !!! Too bad
>In this way if I translate the camera in that point I can
move it ONLY EVERY
>1000000 metres. Infact the 32 bit floating point
give 23 bit for the
>significant (about 8000000 units).
>I try to use the double floating point, in this way I
increase the accuracy
>but it's still not enough.
>Now I think that there is a way to do this. How is
programmed the 16 bit
>game -Frontier- otherwise?
I received some interesting solutions (as the use of space
warps, or hierarchical management of sub-regions). But none of
them faced directly the discouraging problem.
It must be considered that also the speed will suffer
because of the same problem. In fact, with great shifts, the
floating point calculation loses precision. To imagine the
effect think about two object that fly at the same very high
speed in the same direction so that if you see one of them
from the other you can't see movement. If one of them increase
its velocity of a little step you can't see the movement!
Another
great problem is the Z-buffer saturation when you draw big
objects (planets and stars) at far distance.
For many days I thought about a solution and, after an hard
work, I solved it.
No tricks and hybrid solutions! The engine, for now, manages
about 20 hundred millions of kilometers without any loss.
|
|