Re: [osg-users] OSGEarth precision

2009-02-04 Thread Robert Osfield
Hi David,

I haven't dived into the source code of osgEarth, but I do know that
it utilises osgTerrain, and osgTerrain internally uses double to
locate tiles in their geocentric position (the class that does this is
the osgTerrain::Locator).  When the geometry for rendering is
generated on demand it's created with a local origin and then
decorated with a MatrixTransform that places the tile into it's final
position.

Since the OSG defaults to use double Matrix for MatrixTransform and
doubles for all osg::Camera management, and the cull traversal
accumulates the camera + transforms in the scene using doubles, it's
possible to position the tiles very accurately and maintain precision
for as long as possible before passing to OpenGL.

When you are close to a tile, such as driving along it the relative
translations of the camera and the tile's MatrixTransform largely
cancel out  with little numerical errors thank's to the use of
doubles, so you get the best precision where you need it most, while
far away tiles have larger translations left in them so the error is
higher, but this is not an issue as vertices and divide by their
distance during the transformation from object to clip space so the
errors seen on screen remain subpixel so you don't see them.

Thanks to this system it's possible to use pre-built
VirtualPlanetBuilder or dynamically generated osgEarth databases in
geocentric coords without complex additional coding, it just works out
of the box.

Whether you'd want to use a dynamically generated database from remote
data for a simulator is a different matter, one would have to look
closely at the latency and consistency of download and generating
tiles.

Robert.

On Wed, Feb 4, 2009 at 7:10 AM, David Karlsson david.karls...@foi.se wrote:
 Hi,

 Is OSGEarth suitable to use, as a part of a terrain simulator, together with 
 objects that needs to be positioned with about cm precision - or will I run 
 into problems with precision? I found this page about  how they handled it in 
 NASA's World Wind: 
 http://www.urbanrobots.com/Blogs/WW/2006/01/working-to-solution-in-precision.html

 How is this handled in OSGEarth?

 Thanks,
 David
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSGEarth precision

2009-02-04 Thread Glenn Waldron
David,

I'll just chime in for the record to echo Robert's correct assessment --
osgEarth uses osgTerrain under the hood, and osgTerrain solves the precision
issue by localizing each tile at each level of detail with a
double-precision matrix.


Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791


On Wed, Feb 4, 2009 at 4:14 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi David,

 I haven't dived into the source code of osgEarth, but I do know that
 it utilises osgTerrain, and osgTerrain internally uses double to
 locate tiles in their geocentric position (the class that does this is
 the osgTerrain::Locator).  When the geometry for rendering is
 generated on demand it's created with a local origin and then
 decorated with a MatrixTransform that places the tile into it's final
 position.

 Since the OSG defaults to use double Matrix for MatrixTransform and
 doubles for all osg::Camera management, and the cull traversal
 accumulates the camera + transforms in the scene using doubles, it's
 possible to position the tiles very accurately and maintain precision
 for as long as possible before passing to OpenGL.

 When you are close to a tile, such as driving along it the relative
 translations of the camera and the tile's MatrixTransform largely
 cancel out  with little numerical errors thank's to the use of
 doubles, so you get the best precision where you need it most, while
 far away tiles have larger translations left in them so the error is
 higher, but this is not an issue as vertices and divide by their
 distance during the transformation from object to clip space so the
 errors seen on screen remain subpixel so you don't see them.

 Thanks to this system it's possible to use pre-built
 VirtualPlanetBuilder or dynamically generated osgEarth databases in
 geocentric coords without complex additional coding, it just works out
 of the box.

 Whether you'd want to use a dynamically generated database from remote
 data for a simulator is a different matter, one would have to look
 closely at the latency and consistency of download and generating
 tiles.

 Robert.

 On Wed, Feb 4, 2009 at 7:10 AM, David Karlsson david.karls...@foi.se
 wrote:
  Hi,
 
  Is OSGEarth suitable to use, as a part of a terrain simulator, together
 with objects that needs to be positioned with about cm precision - or will I
 run into problems with precision? I found this page about  how they handled
 it in NASA's World Wind:
 http://www.urbanrobots.com/Blogs/WW/2006/01/working-to-solution-in-precision.html
 
  How is this handled in OSGEarth?
 
  Thanks,
  David
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSGEarth precision

2009-02-03 Thread David Karlsson
Hi,

Is OSGEarth suitable to use, as a part of a terrain simulator, together with 
objects that needs to be positioned with about cm precision - or will I run 
into problems with precision? I found this page about  how they handled it in 
NASA's World Wind: 
http://www.urbanrobots.com/Blogs/WW/2006/01/working-to-solution-in-precision.html

How is this handled in OSGEarth?

Thanks,
David
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org