查看: 846|回复: 0

osgearth在Mac OSX上高程加载失败

[复制链接]

该用户从未签到

发表于 2016-10-21 14:33:58 | 显示全部楼层 |阅读模式
本帖最后由 freeblow 于 2016-10-21 14:36 编辑

#include <osg/Notify>
#include <osgGA/GUIEventHandler>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgEarth/MapNode>
#include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/AutoClipPlaneHandler>
#include <osgEarthUtil/Controls>
#include <osgEarthSymbology/Color>
#include <osgEarthDrivers/tms/TMSOptions>

using namespace osgEarth;
using namespace osgEarth:rivers;
using namespace osgEarth::Util;

/**
* How to create a simple osgEarth map and display it.
*/
int
main(int argc, char** argv)
{
    osg::ArgumentParser arguments(&argc,argv);
   
    osg::setNotifyLevel(osg::INFO);

    // create the map.
    Map* map = new Map();

    // add a TMS imager layer:
    TMSOptions imagery;
    imagery.url() = "http://readymap.org/readymap/tiles/1.0.0/7/";
    map->addImageLayer( new ImageLayer("Imagery", imagery) );

    // add a TMS elevation layer:
    TMSOptions elevation;
    elevation.url() = "http://readymap.org/readymap/tiles/1.0.0/9/";
   
    map->addElevationLayer( new ElevationLayer("Elevation", elevation) );
   

    // make the map scene graph:
    MapNode* node = new MapNode( map );

    // initialize a viewer:
    osgViewer::Viewer viewer(arguments);
    viewer.setCameraManipulator( new EarthManipulator );
    viewer.setSceneData( node );

    // add some stock OSG handlers:
    viewer.addEventHandler(new osgViewer::StatsHandler());
    viewer.addEventHandler(new osgViewer::WindowSizeHandler());
    viewer.addEventHandler(new osgViewer::ThreadingHandler());
    viewer.addEventHandler(new osgViewer:ODScaleHandler());
    viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
    viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
   
    viewer.setUpViewInWindow(100, 100, 640, 480);

    return viewer.run();
}


其实就是,application_osgearth_map 这个demo。日志看了,看不出来~
请各位大神,帮忙看看~
屏幕快照 2016-10-21 14.30.55.png
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表