Giter Site home page Giter Site logo

simple-digital-earth's Introduction

Simple Digital Earth

介绍

  • 基于MFC和osgEarth的简单数字地球,包括加载OSG模型,加载高程图、地形图、局部纹理。

  • 虽然编码都由本人完成,但是特别感谢OSG中文社区,中文社区提供的各种资源让我快速入门了OSG。

  • 仓库中只提供了代码,其他文件和数据可在 安装教程 中的链接中找到。

软件架构

  • 最重要的类是COSGObject,用于加载模型,操作图层、视角,并获取视角坐标、人的坐标,反馈到界面上。

  • 地球的加载主要依靠DigitalMap.earth文件,它用xml的形式定义了各个图层,我们在代码中利用ImageLayer等类操作图层。图层的来源有.shp.tif等多种形式的文件。

  • 除了DigitalMap.earth,国旗、动物等实体没有定义在.earth中,而是使用了命名空间osgDB中的函数来分别读取.png.osg文件,将其作为OSG节点,并设置光照、坐标变换。

安装教程

  1. 下载程序压缩包,可以用OSG中文网的资源,感谢OSG中文网。

  2. 解压后有三个文件夹:DigitalEarth、OSG、osgEarth,解压路径不要有中文!!!!! MFC应用对中文路径可能不是太友好。

  3. 在编辑环境变量的界面,点击 新建 ,写入OSG、osgEarth文件夹中的bin目录及其子目录osgPlugin-3.6.5的路径,比如我的OSG中bin文件夹的路径为D:\Environment\OSG\OSG\bin,我就新建环境变量加入D:\Environment\OSG\OSG\bin,同理加入D:\Environment\OSG\OSG\bin\osgPlugins-3.6.5D:\Environment\OSG\osgEarth\binD:\Environment\OSG\osgEarth\bin\osgPlugins-3.6.5,这些路径。点文件资源管理器上方的文件夹图标就能复制路径,一共要加 四个路径!!!!

输入图片说明

输入图片说明

  1. 添加好环境变量后一路确定。然后按键盘WIN+R,输入cmd,在弹出的命令行窗口中依次输入两个命令osgversionosgearth_version,若输出和图中一样,则说明配置成功; 如果不一样就重启电脑,再次打开命令行窗口输入命令,一般重启后就会好

输入图片说明

输入图片说明

输入图片说明

输入图片说明

输入图片说明

  1. 打开DigitalEarth文件夹,双击DigitalEarth.exe就可,文件夹里的东西 不要乱动

使用说明

  • 在视图区打钩可设置图层是否可见。

  • 等高线在西藏与印度接壤处一块黑色的地方,放大可看到等高线。

输入图片说明

  • 局部高清图在浙江省,在浙江省德清县尤为高清,若找不到德清县,直接点击野外考查-->前往,就能到德清县附近,那里会有一头牛。等高线的位置也是局部高清图。

输入图片说明

  • 在飞行输入位置信息可快速到达那个位置,经度范围-180~180,纬度范围-90-90, 输入超出这个范围程序可能崩溃

  • 刚打开可能有点卡,等一段时间就好。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.