SHARE
TWEET

Untitled

a guest Mar 27th, 2018 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. osg::Vec3 apply(const osg::Vec3& v)
  2.     {
  3.         osg::EllipsoidModel em;
  4.         em.computeLocalToWorldTransformFromLatLongHeight(osg::DegreesToRadians(_latitude), osg::DegreesToRadians(_longitude), _altitude, l2w);
  5.  
  6.         osg::Vec3d ecef = osg::Vec3d(v) * l2w;
  7.  
  8.         double lat;
  9.         double lon;
  10.         double alt;
  11.  
  12.         em.convertXYZToLatLongHeight(ecef.x(), ecef.y(), ecef.z(), lat, lon, alt);
  13.         em.convertLatLongHeightToXYZ(lat, lon, _altitude+v.z(), ecef.x(), ecef.y(), ecef.z());
  14.  
  15.         osg::Vec3d origin;
  16.         em.convertLatLongHeightToXYZ(osg::DegreesToRadians(_latitude), osg::DegreesToRadians(_longitude), _altitude, origin.x(),origin.y(),origin.z());
  17.  
  18.         osg::Vec3 result = ecef - origin;
  19.        
  20.         return result;
  21.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top