一、代码
输入为均经纬高度
#include <osgViewer/Viewer>
#include <osg/Math>
#include <osgDB/ReadFile>
#include <osg/NodeCallback>
#include <osg/MatrixTransform>
#include<osg/PositionAttitudeTransform>
//键盘事件
#include<osgViewer/ViewerEventHandlers>
//osgGA相关的库
#include<osgGA/StateSetManipulator>
#include<osgGA/TrackballManipulator>
#include<osgGA/DriveManipulator>
//osgEarth相关库
#include<osgEarthUtil/EarthManipulator>
#include<osgEarth/Map>
#include<osg/lineWidth>
#include <osgEarthAnnotation/PlaceNode>
#include <osgEarthSymbology/Style>
#include <osgEarthSymbology/Geometry>
#include<osgEarth/GeoMath>
#include <vector>
double GetDis(osg::Vec3 from, osg::Vec3 to)
{
return sqrt((to.x() - from.x())*(to.x() - from.x()) + (to.y() - from.y())*(to.y() - from.y()) + (to.z() - from.z())*(to.z() - from.z()));
}
osg::Vec3d LngLatHeight2XYZ(os