Earth-Simulation, Ohad Eder Pressman, 2001
After the WTC attacks, CNN started using their Weather-System Simulation Program (I think) to show Afghanistan and Tomahawk missiles flying :)
This looked very nice and moved by the fact that I really didn't know too much geography and had a day or two free (Sukkot Holiday), I went on and wrote my own Earth Simulation program.
The program is based on a large sphere, with a nice texture of the earth is mapped to. You can rotate the earth, zoom-in, etc, etc.
What's GIS you ask ? Well, GIS stands for 'Geographical Information System', which actually means adding any type of information layer to a raster or vector map of the world or a portion of it.
What do I have to do with GIS ? After rotating my small earth for a few minute I started to get bored again, so I went on a hunt to find information layers that I could add.
Where did the information come from ?
-------------------------------------
The information about the location of the Countries came from something called 'The CIA FactBook 2000'. It's basically an html page with links to about 200+ countries, each one has a page with facts (including Latitude/Longitude information). I downloaded all the pages using Flashget's 'Download All' (thank god for that option), and wrote a small program that fetches all the countries names and positions and generates a '.H' file with all this information.
Vector information on Coastlines, Political Boundaries, Rivers, Lakes, Islands and US-States was much harder to get.
I searched for a long time and eventually picked up the basic binary data from the Pospeschil Micro World Data Bank II. I couldn't manage to understand the format or find any explanation of it. I then used a trial-version of a program called Idrisi to convert the pairs of the '.vec' and 'dvc' files into '.vct' and '.vdc' (these are also binary files). I then used the same program to read in the '.vct' and '.vdc' files and write out '.vxp' files. Now, the '.vxp' files are an easily understandable text-representation of the vector data. I wrote something small to convert the '.vxp' ASCII files into a binary equivilant (Binary Vector Data - '.bvd') [this isn't a public format, just something I hacked for fast loading]. And eventually our program uses the '.bvd' files directly :)
The small conversion programs are included with the source-code provided below. I didn't include all the versions of the data because they take almost 10MB alltogether.
Now, What can we do with the program (function-wise) ?
------------------------------------------------------
You can enable/disable the big Earth-Texture.
You can enable/disable Wire-Frame mode.
You can play with the line-width used by the wire-frame mode and the vector-data.
You can enable/disable the display of Country-Names.
You can seperately enable/disable the display of all the vector-layers (Coast-Lines, Islands, Lakes, Rivers, Nation Boundaries and US-States).
Some Notes on the application itself :
--------------------------------------
Use the mouse and it's left-button to rotate earth. Hold down Ctrl before you hit the left mouse button to scale the earth. Right-Click the window to get the options menu. Note that options are controllable by keyboard too.
Country Names are shown based on Z, the more you zoom in the more country-names appear. Countries are shown using small red sine-scaling glutSolidCubes.
Some notes on the 3D :
----------------------
I used OpenGL for this one, it was simple and straightforward. I generate a large sphere for the earth, use glSolidCubes for the countries, and simple GL_LINE_STRIPs for the vector-data. There are no display-lists or any other optimizations, I just throw everything at the card :)
I used glut for wrapping up all of Windows's internal calls, mainly because the first app-skeleton I found used it and provided some minimal texture-loading calls. Apparently the skeleton is by Andreas Gustafsson, I can't remember where exactly I found it, sorry.
I used a font library called glTexFont by Nate Miller, it uses the Quake3 Font, cool :)
Some thanks to the people at #opengl (efnet I believe) for helping me correctly placing the country-names (especially f00Dave, thanks for all the help).
The source is provided for your enjoyment, free-use, modification, etc. Feel free to contact me if you find a bug, add a feature, or anything alike.
email : ohad@visual-i.com
web : ohad.visual-i.com
没有合适的资源?快使用搜索试试~ 我知道了~
画人物的超级很好很强大的VC++程序
共34个文件
bvd:6个
txt:6个
h:5个
4星 · 超过85%的资源 需积分: 10 32 下载量 184 浏览量
2009-05-27
10:21:55
上传
评论 1
收藏 3.84MB ZIP 举报
温馨提示
画人物的超级很好很强大的VC++程序,追适合画裸体图
资源推荐
资源详情
资源评论
收起资源包目录
71477214earth_simul.zip (34个子文件)
earth simulation
earth.dsp 4KB
gltexfont
glTexFont.lib 22KB
glTexFont.h 4KB
gltexfontdoc.html 13KB
font.tga 256KB
glTexFontEx.c 4KB
LICENSE.TXT 2KB
readme.txt 2KB
glut32.dll 216KB
countries
StdAfx.cpp 296B
countries.cpp 2KB
ReadMe.txt 1KB
StdAfx.h 667B
countries.dsp 4KB
countries.dsw 541B
countries.h 11KB
earth.cpp 12KB
glut
glut.h 27KB
README-win32.txt 25KB
glut32.lib 28KB
earth.dsw 535B
GLTexture.h 783B
earth.exe 84KB
images
earth.tga 6MB
readme.txt 4KB
GLTexture.cpp 5KB
vector data
coast.bvd 588KB
river.bvd 221KB
state.bvd 18KB
nation.bvd 176KB
vxp_to_bvd.cpp 2KB
lake.bvd 119KB
island.bvd 276KB
www.pudn.com.txt 218B
共 34 条
- 1
资源评论
- 嫦娥奔月月2013-06-04挺好玩的~~
yangfeifeichenyu
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功