随笔分类 - 开源项目学习
学习一些优秀的开源项目!
摘要: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
阅读全文
摘要:从WW中剥离一个三维场景框架,初步实现的一个。可以绘制一个三角形,但是不能够控制摄像机,没有增加鼠标事件。没有投影,世界变幻之类的东西。以后会不断学习逐步增加进来。 下载地址 下载V1.0.0.2
阅读全文
摘要:视域调度(视域体裁剪) 在WW中用户改变自己的的视角,纹理影像和高程会动态加载,在视野范围内的影像和DEM显示,超出视域范围的瓦片则不显示。不仅是瓦片,太阳、大气网格、三维模型ModelFeature等都会相应的进行剔除。 看了ROAM相关的的视域体裁剪论文,有好多采用的是将视域体投影的简化算法。WW是否也是这样?我原来以为是,后来在群里和别人聊,说到了Frustum,才知道这个东西的作用。 这里涉及的类主要是World_Wind_1.4.0_Source\PluginSDK\ViewFrustum.cs文件中的Frustum类。 查看Frustum类,包含公有字段public Pla...
阅读全文
摘要: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...
阅读全文
摘要: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 { ...
阅读全文
摘要: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
阅读全文
摘要:可直接复用。 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 ...
阅读全文
摘要:WW目前的服务器似乎都连不上了,不知道Java版的是不是可以!WW实现了旗帜标注,鼠标移动到旗帜的位置,旗帜会高亮显示。点击,探出对话框显示标注的信息。1.WavingFlagLayer对象public class WavingFlagLayer : RenderableObjectWavingFlagLayer继承自RenderableObject,定义了三个事件如下:1 public event System.EventHandler OnMouseEnterEvent;2 public event System.EventHandler OnMouseLe...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要:首先查看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 *= ...
阅读全文
摘要: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 ...
阅读全文
摘要:首先介绍一下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...
阅读全文
摘要:首先查看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...
阅读全文
摘要: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...
阅读全文
摘要:1.CGAL:概览 CGAL,是由European Community成立的大型项目。目的是开发可以普遍应用于计算几何的一系列对象和函数,并使他们在应用领域和非专业人士可方便使用。 CGAL项目致力于提供健壮(robust),灵活高效的代码。模板和特征类这些方法受STL的启发。 项目由三部分组成:K
阅读全文