合集-WorldWind
摘要:1.WorldWind资源下载:http://worldwindcentral.com/wiki/NASA_World_Wind_Download或者SourceForge上下载。2.依赖:d3d9托管类库,通过安装WorldWind获得 编译项目3.Main程序入口 在WorldWind.cs文件中查看,Main()函数写在public class MainApplication : System.Windows.Forms.Form, IGlobe类内部。 1 /// <summary> 2 /// The main entry point. Parses argu...
阅读全文
摘要:首先查看WorldWindow 的构造函数,接着查看InitializeGraphics()函数。 1 public WorldWindow() 2 { 3 this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); 4 5 // The m_Device3d can't be created unless the control is at least 1 x 1 pixels in size 6 thi...
阅读全文
摘要:首先介绍一下Device类,Device位于using Microsoft.DirectX.Direct3D;命名空间下。 Device类用于完成DirectX 里所有绘图操作,我们可以把这个类假想为图形卡,场景里所有其他图形对象都依赖于Device,计算机里可以有多个Device对象。所以在全局变量中定义一个绘图设备,如下代码: private Device m_Device3d;//定义绘图设备 1 private void InitializeGraphics() 2 { 3 // Set up our presentation par...
阅读全文
摘要:WorldWind的WorldWindow控件包含只读属性DrawArgspublic DrawArgs DrawArgs { get { return this.drawArgs; } }DrawArgs渲染参数对象,负责记录当前渲染的各个参数WorldWindow的CurrentWorld属性赋值时也给drawArgs的CurrentWorld赋值。View Code 1 public World CurrentWorld 2 { 3 get 4 { 5 ...
阅读全文
摘要:首先查看WorldWindow的事件:OnMouseUp、OnMouseMove、HandleKeyDown,这几个方法中多次调用this.drawArgs.WorldCamera的各种属性实现了场景的控制,包括球的旋转、场景的放大缩小,上下移动。 1. 接下来查看CameraBase类RotationYawPitchRoll虚函数: 1 public virtual void RotationYawPitchRoll(Angle yaw, Angle pitch, Angle roll) 2 { 3 // this._orientation *= ...
阅读全文
摘要:public class World : RenderableObjectWorld对象是WW中最重要的对象,他包含了一个渲染对象的集合,同时他自身也是一个渲染对象。重载的Render方法: 1 public override void Render(DrawArgs drawArgs) 2 { 3 try 4 { 5 6 if (m_WorldSurfaceRenderer != null && World.Settings.UseWorldSurfaceRenderer) 7 ...
阅读全文
摘要:RenderableObject是一个抽象类,继承自接口IRenderable和IComparable。继承自RenderableObject类的有:RenderableObjectList、World、ImageLayer、PolygonLayer、TerrainPath、ShapeFileLayer、ShapeLayer、WavingFlagLayerpublic abstract class RenderableObject : IRenderable, IComparable
阅读全文
摘要:MainApplication的构造函数599行实例化了worldWindow的Cache属性。// set Upper and Lower limits for Cache size control, in bytes long CacheUpperLimit = (long)Settings.CacheSizeMegaBytes * 1024L * 1024L; long CacheLowerLimit = (long)Settings.CacheSizeMegaBytes * 768L * 1024L; //75% of ...
阅读全文
摘要:CameraBase类方法PickingRayIntersection:View Code 1 /// <summary> 2 /// Calculates latitude/longitude for given screen coordinate. 3 /// </summary> 4 public virtual void PickingRayIntersection( 5 int screenX, 6 int screenY, 7 out Angle latitu...
阅读全文
摘要:WW的插件结构很神奇,内部插件编译在DLL中,外部的则直接以.cs文件的形式加载,路径(C:\Program Files (x86)\NASA\World Wind 1.4\Plugins) 内部的以Assembly类来动态加载,外部的CodeDomProvider动态编译后加载! PluginCompiler.cs文件中的方法public void Load(PluginInfo pi) 1 /// <summary> 2 /// Load a plugin 3 /// </summary> 4 public void Load(Pl...
阅读全文
摘要:TerrainViewer的入口Main()函数:View Code 1 static void Main(string[] args) 2 { 3 using (Viewer viewer = new Viewer()) 4 { 5 viewer.ProcessArgs(args); // Read command line args 6 viewer.InitializeDevice(); // Direct 3D device setu...
阅读全文
摘要:WW目前的服务器似乎都连不上了,不知道Java版的是不是可以!WW实现了旗帜标注,鼠标移动到旗帜的位置,旗帜会高亮显示。点击,探出对话框显示标注的信息。1.WavingFlagLayer对象public class WavingFlagLayer : RenderableObjectWavingFlagLayer继承自RenderableObject,定义了三个事件如下:1 public event System.EventHandler OnMouseEnterEvent;2 public event System.EventHandler OnMouseLe...
阅读全文
摘要:可直接复用。 1 using System; 2 using System.IO; 3 using System.Diagnostics; 4 using System.Windows.Forms; 5 6 namespace Utility 7 { 8 public class LogEventArgs : EventArgs 9 { 10 public int level; 11 public string category; 12 public string message; 13 14 ...
阅读全文
摘要:ConfigurationLoader主要负责WW中各个图层的加载。首先看看安装目录Config文件夹下Earth.xml文件View Code 1 <?xml version="1.0" encoding="UTF-8"?> 2 <World Name="Earth" EquatorialRadius="6378137.0" LayerDirectory="Earth" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst
阅读全文
摘要:http://blog.csdn.net/jk276993857/article/details/5951738验证其可行性。只是模型太小,很难找到。在ConfigurationLoader.cs和ModelFeature类中设置断点监视: 1 public override void Initialize(DrawArgs drawArgs) 2 { 3 if(!IsVisible(drawArgs.WorldCamera)) 4 return; 5 6 try 7 { ...
阅读全文
摘要:1. 基本概念: World Wind Tile Structure: WW瓦片数据结构 默认浏览器纹理数据存放在\Cache\Earth\Images\NASA Landsat Imagery\NLT Landsat7 (Visible Color),和高程数据一样分层存储,从服务器下载的图像为JPG格式,512*512像素,下载完毕后转换为DDS格式,DTX3压缩,所占空间会增大一倍多,但据说运行时可节约50%内存。下载的临时文件后缀为jpg.tmp,下载出错后会多一个0字节的jpg.txt文件。 国界数据存放在Cache\Earth\Boundaries\Country Polit...
阅读全文
摘要:视域调度(视域体裁剪) 在WW中用户改变自己的的视角,纹理影像和高程会动态加载,在视野范围内的影像和DEM显示,超出视域范围的瓦片则不显示。不仅是瓦片,太阳、大气网格、三维模型ModelFeature等都会相应的进行剔除。 看了ROAM相关的的视域体裁剪论文,有好多采用的是将视域体投影的简化算法。WW是否也是这样?我原来以为是,后来在群里和别人聊,说到了Frustum,才知道这个东西的作用。 这里涉及的类主要是World_Wind_1.4.0_Source\PluginSDK\ViewFrustum.cs文件中的Frustum类。 查看Frustum类,包含公有字段public Pla...
阅读全文
摘要:WorldWind实时确定、更新、初始化和渲染地形和纹理数据 原文链接: http://www.cnblogs.com/rainbow70626/p/5597267.html 当用户点击WorldWind中的地球时,首先响应的是WorldWindow.OnPaint()函数,后续程序的调用流程如下图
阅读全文
摘要:In some applications exact time measurement methods are very important.一些应用程序中精确的时间测量是非常重要的。The often used Windows API method GetTickCount() retrieves the number of milliseconds that have elapsed since the system was started, but the GetTickCount() function only archieve resolutions of 1ms and on th
阅读全文
摘要:1 using System; 2 using System.Diagnostics; 3 using System.Globalization; 4 using System.Net; 5 using System.IO; 6 using System.IO.Compression; 7 using System.Threading; 8 using System.Xml; 9 using Utility; 10 using WorldWind; 11 12 namespace WorldWind.Net 13 { 14 public delegate void...
阅读全文
摘要:PluginSDK\ShapeFileLayer.cs Line:1027char[] fieldDataChars = dbfReader.ReadChars(fieldHeaders[j].FieldLength); string fieldData = new string( fieldDataChars ); 为 byte[] fieldDataChars = dbfReader.ReadBytes(fieldHeaders[j].FieldLength); string fieldData = System.Text.Encoding.Default.GetString( field
阅读全文
摘要:本来希望从GlobeMapper中生成切片直接加载到WorldWind中,但是没有成功!所以想比较一下和dstile生成的瓦片到底有什么区别?所以这才第一次生成并加载了影像瓦片。貌似和GlobeMapper中的区别是路径的命名方式不一样!GlobeMapper是xx_xx.jpg,文件夹也都是两位。而dstile或者说WW需要的是4位,即xxxx_xxxx.jpg。——2013.10.24-------------------------------------今天又测试了一下,证明了GlobeMapper中制作的切片确实可以在WorldWind中显示。跟踪代码QuadTile类Initial
阅读全文
摘要:在这里我们看到判断Lod的级别主要有三个条件: * 1、相机视角范围,视角范围越大,所包含的tileSize就越大 * 2、相机与瓦片距离,距离越远,所包含的tileSize也就越大 * 3、相机视锥与瓦片是否相交 相对应我们可以把视角剔除方法理解成以下三步: * 1、根据视角范围,画个大圈,把大圈
阅读全文
摘要:QuadTile的CreateElevatedMesh()方法中:1 //获取地形瓦片2 TerrainTile tile = QuadTileSet.World.TerrainAccessor.GetElevationArray(North + degreePerSample, South - degreePerSample, West - degreePerSample, East + degreePerSample, vertexCountElevated + 3);3 float[,] heightData = tile.ElevationData;调用了World的TerrainA.
阅读全文
浙公网安备 33010602011771号