#include <osgEarthDrivers/model_simple/SimpleModelOptions>

 

SimpleModelOptions modelOptions;
modelOptions.url() = "cow.osg.(100,100,100).scale";
modelOptions.location() = osg::Vec3(116, 40, 100);//北京地区坐标
map->addModelLayer(new ModelLayer("model layer", modelOptions));

//视点定位北京地区
osgEarth::Viewpoint vp("", 116, 40, 0.0, -2.50, -90.0, 1.5e6);
(dynamic_cast<EarthManipulator*>(viewer.getCameraManipulator()))->setViewpoint(vp);

 

 

有时候模型没有纹理,需要.osgearth_shadergen插件

osg::Node* cessna = osgDB::readNodeFile("data/model/su33.ive.osgearth_shadergen.1.scale");

相关文章:

  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2021-07-31
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2021-10-15
  • 2021-11-11
  • 2021-06-05
相关资源
相似解决方案