V'ger needs more data....
what sensor(s) are you using ? is this all in software ?
does inertia have any effect ?
One way is to use the center of the space as 0,0,0
although you move from there to some other place, you are still referenceing your absolute coordinates based on 0,0,0
your new relational coordinates would not change your absolute, only plot where you are.
you should be able to have two simultaneous 2D calculations to give you location in your 3D environment.