参考:http://docs.osgearth.org/en/latest/faq.html

Common Usage

How do I place a 3D model on the map?

The osgEarth::GeoTransform class inherits from osg::Transform and will convert map coordinates into OSG world coordinates for you:

GeoTransform* xform = new GeoTransform();
...
xform->setTerrain( mapNode->getTerrain() );
...
GeoPoint point(srs, -121.0, 34.0);
xform->setPosition(point);

I added a node, but it has no texture/lighting/etc. in osgEarth. Why?

Everything under an osgEarth scene graph is rendered with shaders. So, when using your own models (or creating geometry by hand) you need to create shader components in order for them to render properly.

一切在osgEarth场景图呈现着色器。因此,当使用您自己的模型(或手工创建几何)您需要创建材质组件为了正确地呈现。

osgEarth has a built-in shader generator for this purpose. Run the shader generator on your node like so:

为此osgEarth有一个内置的着色器生成器。在节点上运行着色器生成器:

osgEarth::Registry::shaderGenerator().run( myNode );

After that, your node will contain shader snippets that allows osgEarth to render it properly and for it to work with other osgEarth features like sky lighting.

之后,节点将包含材质片段,允许osgEarth渲染它正确,工作与其他osgEarth天空照明等功能

How do make the terrain transparent?

By default, the globe will be opaque white when there are no image layers, or when all the image layers have their opacities set to zero. To make the underlying globe transparent, set the base color of the terrain to a transparent color like so:

<map>
<options>
<terrain color="#ffffff00" ...

In code, this option is found in the MPTerrainEngineOptions class:

#include <osgEarthDrivers/engine_mp/MPTerrainEngineOptions>
using namespace osgEarth::Drivers::MPTerrainEngine;
...
MPTerrainEngineOptions options;
options.color() = osg::Vec4(1,1,1,0);

How do I set the resolution of terrain tiles?

Each tile is a grid of vertices. The number of vertices can vary depending on source data and settings. By default (when you have no elevation data) it is an 17x17 grid, tessellated into triangles.

You can expressly set the terrain’s tile size by using the Map options. osgEarth will then resample all elevation data to the size you specify:

每个瓦是一个网格的顶点。顶点的数量取决于源数据和设置。在默认情况下(当你没有高程数据)这是一个17 x17网格,完全嵌合成三角形。

<map>
<options>
<terrain>
<tile_size>65</tile_size>
...

Other Terrain Formats

Does osgEarth work with VirtualPlanetBuilder?

VirtualPlanetBuilder (VPB) is a command-line terrain generation tool. Before osgEarth came along, VPB was probably the most-used open source tool for building terrains for OSG appliations. We mention is here because many people ask questions about loading VPB models or transitioning from VPB to osgEarth.

osgEarth differs from VPB in that:

  • VPB builds static terrain models and saves them to disk. osgEarth generates terrain on demand as your application runs; you do not (and cannot) save a model to disk.
  • Changing a VPB terrain generally requires that you rebuild the model. osgEarth does not require a preprocessing step since it builds the terrain at run time.
  • osgEarth and VPB both use GDAL to read many types of imagery and elevation data from the local file system. osgEarth also supports network-based data sources through its plug-in framework.

osgEarth has a VPB driver for “scraping” elevation and imagery tiles from a VPB model.

翻译:1VPB构建静态地形模型和保存到磁盘。osgEarth生成地形在您的应用程序运行时需求;你不会(也不能)模型保存到磁盘。
2改变一个VPB地形一般要求你重建模型。osgEarth不需要预处理步骤,因为它在运行时构建地形。
3osgEarth和VPB都使用GDAL阅读许多类型的图像和高程数据从本地文件系统。osgEarth通过其插件框架还支持基于网络的数据源。

Confiugration of this driver is quite tricky and requires you to understand the details of how VPB models are organized. You’re on your own.

Please Note that this driver only exists as a last resort for people that have a VPB model but no longer have access to the source data from which it was built. If at all possible you should feed your source data directly into osgEarth instead of using the VPB driver.

Can osgEarth load TerraPage or MetaFlight?

osgEarth cannot load TerraPage (TXP) or MetaFlight. However, osgEarth does have a “bring your own terrain” plugin that allows you to load an external model and use it as your terrain. The caveat is that since osgEarth doesn’t know anything about your terrain model, you will not be able to use some of the features of osgEarth (like being able to add or remove layers).

For usage formation, please refer to the byo.earth example in the repo.

[原][osgearth]FAQ的更多相关文章

  1. [原][osgEarth]添加自由飞行漫游器

    //头文件里 #define MANIPULATOR_W 0x01#define MANIPULATOR_A 0x02#define MANIPULATOR_S 0x04#define MANIPUL ...

  2. [原][osgEarth]在osgearth中添加相机路径动画

    在osg中添加相机动画路径请参考:http://www.cnblogs.com/lyggqm/p/8075277.html 这里的代码是在osgearth中添加相机动画路径漫游器: #include ...

  3. [原][osgearth]设置OE的高程,高度场的数据。修改设置高度值

    ; row < hf->getNumRows(); ++row ) { ; col < hf->getNumColumns(); ++col ) { float val = h ...

  4. [原][osgearth]osgearthviewer读取earth文件,代码解析(earth文件读取的一帧)

    跑osgearthviewer程序 使用一个earth文件做参数传入 跟进代码. 首先osgearthviewer程序加载earth的方式分为两种: 1.根据earth文件(load方式) 2.使用S ...

  5. [原][osgearth]API加载earth文件的解析

    参考:http://blog.csdn.net/cccstudyer/article/details/17691893 通过\src\osgEarthDrivers\earth\ReaderWrite ...

  6. [原][osgearth]earth文件加载道路一初步看见模型道路

    时间是2017年2月5日17:16:32 由于OE2.9还没有发布,但是我又急于使用OE的道路. 所以,我先编译了正在github上调试中的OE2.9 github网址是:https://github ...

  7. [原][osgearth]osgearth本地(离线)数据源处理小结

    参考:http://docs.osgearth.org/en/latest/data.html Processing Local Source Data If you have geospatial ...

  8. [原][osgEarth][JSBSim]重新整理使用JSBSim飞机动力模拟的使用

    JSBSim是一个模拟飞机飞行空气动力学的,这些都不用深入理解,只要知道自己程序怎么和JSBSim交互就行了 我使用的是JSBSim-Win32-0.9.13 原理:改写jsbsim的FGInput ...

  9. [原][osgearth]OE地形平整代码解读

    在FlatteningLayer文件的createHeightField函数中:使用的github在2017年1月份的代码 if (!geoms.getComponents().empty()) { ...

随机推荐

  1. Thinkphp的cookie的怎么玩?

    在使用COOKIE的时候,首先要对COOKIE进行加密,加密方式采用:异位或的方式进行加密: // 异位或加密 1是加密 0 是解密 function encrytion($value,$type=0 ...

  2. apache+tomcat实现session共享

    apache+tomcat上篇文章,实现了负载均衡,现在我们实现session共享 一.tomcat集群配置,session 同步配置: tomcat1配置  A.修改Engine节点信息: < ...

  3. 02.MyBatis配置文件详解

        MyBatis入参考文档:http://mybatis.org/mybatis-3/zh/  1.properties 属性 1.在MyBatis配置文件中引用属性文件     MyBatis ...

  4. jenkins之升级

    首先查看系统war包放置的位置 rpm -ql jenkins 下载一个war包 下载地址 https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.61/ ...

  5. Windows中的DNS服务——正向解析&反向解析配置 分类: AD域 Windows服务 2015-07-16 20:21 19人阅读 评论(0) 收藏

    坚信并为之坚持是一切希望的原因. DNS服务是AD域不可或缺的一部分,我们在部署AD域环境时已经搭建了DNS服务(windows server 2008 R2域中的DC部署),但是DNS服务的作用还是 ...

  6. Python爬虫框架Scrapy实例(一)

    目标任务:爬取腾讯社招信息,需要爬取的内容为:职位名称,职位的详情链接,职位类别,招聘人数,工作地点,发布时间. 一.创建Scrapy项目 scrapy startproject Tencent 命令 ...

  7. Java 算法-快速幂

    1 什么是快速幂? 快速幂,顾名思义就是快速的求次幂,例如:a^b,普通的算法就是累乘,这样的计算方法的时间复杂度就是O(n),而快速幂的方法使得次幂的计算方法的时间复杂度降低到O(logn).  假 ...

  8. 三个在线django速成教程(转)

    add by zhj: 除了这几个在线的,有些书也不错 1. Two Scoops of Django 2. Instant Django 1.5 Application Development St ...

  9. oracle基于3种方法的大数据量插入更新

    过程插入更新的3种方法: a.逐条检查插入或更新,同时执行插入或更新 b.逐条merge into(逐条是为了记录过程日志与错误信息) c.基于关联数组的检查插入.更新,通过forall批量sql执行 ...

  10. android唯一设备标识、设备号、设备ID的获取方法

    ##如何获取Android设备唯一ID? ###问题 每一个android设备都有唯一ID吗?如果有?怎么用java最简单取得呢? ###回答1(最佳) 如何取得android唯一码? 好处: 1.不 ...