On Thu, Nov 11, 2010 at 9:14 AM, Paul Guhl <ad...@simtechnologies.de> wrote:

> Hello!
>
> I'm a hobby programmer and work on a flight simulation project as well
> and would like to ask probably a trivial question:
> Lets the global origin of the coordinate system be at 0deg lat and 0deg
> lon. While moving an aircraft within 100km off the global origin, the
> movement and camera rotation / position work smooth. When moving further
> away the transformations start to jitter increasingly, transformations
> are less exact. The problem is most probably rooted  in rounding error.
> Solution for this problem is the switch to the local coordinate system.
> My question is: how the local/global coordinates are managed in FlightGear?
>
The short answer is: use double precision and forget about the problem. This
isn't the whole story,  of course, because you can't pass doubles to OpenGL
and expect sensible results or good performance, even on the latest,
fanciest hardware. So, we rely on Open Scene Graph to manage this for us.
The geometry for a scenery tile (tiles are about 14km on a side) is stored
in single precision relative to the tile center. Above that we place an OSG
MatrixTransform which stores the geocentric position in double precision.
The eyepoint is also stored in a double. When OSG renders the scene, it
creates a single precision ModelView matrix for each drawable. In the
context of earthly rendering you can count on being able to use floats to
position anything visible.

Where in the code i could reivew your solution?
>
Nowhere and everywhere. Before fg switched to Open Scene Graph there was a
lot of code to deal with this.

> How do you solve the momentum of entering critical distances of the
> local coordinate system, ergo moving local coordinate system to get the
> aircraft back again within the limits of the local coordinate system?
>
I'm not sure if you're referring to the same issue here.

Tim
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to