Hi Pilip,

The OSG can handle ECEF just fine, in fact VirtualPlanetBuilder and
osgEarth both create databases in ECEF and when you using the standard
camera manipulator they will also be in effect in ECEF.  The only real
problem in handling ECEF is that precision problems can exist when you
don't manage the coordinates correctly, the solve this the OSG by
default uses double for all Matrix for both the Camera and internal
transform in the scene graph and when accumulating the modelview
matrix the matrix math is all kept in doubles to maintain precision as
long as possible.  The final bit of jigsaw is that the scene graph
that you are rendering will need to broken up into tiles with each
tile with it's own MatrixTransform above it that places a tile with a
local coordinate frame and origin in the final ECEF.  This combination
of scene graph structure and use of doubles in internal Matrices
avoids the precision issues normally found with ECEF database.

In terms of setting up ECEF and lat/longs the OSG uses an
osg::CoordinateSystemNode to decorate the scene graph generated by VPB
or osgEarth, and this has a osg::ElipsoidModel helper object that
provides methods for conversion between ECEF and lat/longs.

Robert.

On 14 June 2012 12:15, Pilip Rogati <[email protected]> wrote:
> Hi.
> I have a big problem. not sure this is the good place to post this, but here 
> goes.....
> I am working on some aircraft simulation game... Problem for me are 
> coordinates conversion.
> All my coordinates are in ECEF.
> I have problem setting up my camera properly and then later transforming ECEF 
> positions of aircraft so they can be rendered correctly. can someone please 
> tell me the right way to do it, or even better some code would be nice.
>
> for example. my camera is at lat 15, lon 10, elevation 0.
> i want it to look at lat 15.01, lon 10, elevation 0.
> I convert both of theses to ecef, so i have my cameraPosition and 
> cameraTarget.
> how to convert models ecef position so i have opengl x->right, y->up, 
> z->forward?
>
>
> Thank you!
>
> Cheers,
> Pilip
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=48305#48305
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to