#include <Windows.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <cstring>
#include <time.h>
#include <osgEarth/MapNode>
#include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/ExampleResources>
//键盘事件
#include<osgViewer/ViewerEventHandlers>
//osgGA相关的库
#include<osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgDB/WriteFile>
using namespace std;
void addFileList(osg::Group* root, const std::string& file)
{
std::ifstream readData(file.c_str());
if (!readData) return;
while (!readData.eof())//判断文件是否读完
{
//类型
std::string type;
//名称
std::string name;
//模型经纬高
osg::Vec3d LLH;
//模型缩放
osg::Vec3d scale;
//模型旋转
osg::Vec3d rotate;
readData >> type >> name >> LLH[0] >> LLH[1] >> LLH[2] >>
scale[0] >> scale[1] >> scale[2] >>
rotate[0] >> ro
osgearth从配置文件读取模型配置
最新推荐文章于 2024-01-12 11:17:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)