OsgEarth 2.x升级到3.1注意事项

近日把一个开源项目SinianGIS移植到3.1版本的OsgEarth,升级过程中总结了一些2.x升级到3.1版本的注意事项。

2.x3.1
(Symbology, Annotations, Features)引用路径变化原来的osgEarth::Symbology::xxx 更改为osgEarth::xxx 
fast_mapUnorderedMap
TerrainEffects被移除
getProfile()getTilingProfile()
new ImageLayer

ImageLayer::create

或者

new ImageLayer

ImageLayerOptionsImageLayer::Options
MapNodeOptionsMapNode::Options
LabelSource、MapFrame被移除
FeatureSourceFactory / OGRFeatureOptions OGRFeatureSource (osgearth_callouts sample)     osg::ref_ptr<OGRFeatureSource> featureData = new OGRFeatureSource();
Map::isGeocentric()MapNode::isGeocentric()
TerrainLayerTileLayer/TileSourceImageLayer/TileSourceElevationLayer...
earth file: <sky><sky_simple>
osgQtosgQOpenGL

osgEarthDrivers/gdal

osgEarthDrivers/bing

osgEarthDrivers/arcgis

osgEarthDrivers/FeatureSourceLayer

osgEarth/Gdal

osgEarth/Bing

osgEarth/ArcGISServer

osgEarth/FeatureSource

oe_VP->heading() = heading.toDouble();

oe_VP->pitch() = pitch.toDouble();

oe_VP->range() = range.toDouble();

vp->setHeading(Angle(0,  Units::BAM));

vp->setPitch(Angle(-90, Units::BAM));

vp->setRange(Distance(16000, Units::METERS));

需引用using namespace osgEarth::Util;

3.1发现的问题:

打开光照会出现光照不均匀显示

https://github.com/gwaldron/osgearth/issues/1699

解决方法:

Osg编译时打开GL3编译开关,\include\osg\GL头文件加入:
#define OSG_GL3_AVAILABLE

项目源码:

osgEarthTest: osgEarth3.1与各种UI框架集成的示例代码 (gitee.com)

效果图:

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值