ArcEngine+OpenGL之二系统平台搭建

ArcEngine+OpenGL之二系统平台搭建 收藏
系统平台搭建
 
1、建立C#下的ArcEngine的globeControl默认项目,取名为CEnOpenGL.保存。
2、C# Wrapper for OpenGL GL API.(得到OpenGL_GL_v4.cs,OpenGL_GLU_v4.cs,OpenGL_WGL_v4.cs三个c#Wrapper 文件),相关学习。【。net下使用com类的方法。】
注意:本学习的项目必须在Unsafe下编译。
3.项目-属性-生成——选择(不安全代码)选项。
4、The GlobeCore API provides the ICustomGlobeLayer interface for more advanced 3D graphic drawings. Any layer that will be used to perform 3D drawings on the globe display needs to support this interface. This interface simplifies the overhead of writing custom layers for ArcGlobe/GlobeControl. Developers do not have to listen to GlobeDisplayEvents to do their drawings. Instead, ICustomGlobeLayer provides a method (DrawImmediate) where all drawings should take place. 刚开始学习使用监听事件的方法。
5、
The following shows wiring AfterDraw inside the ICommand.Onclick event handler using GlobeHookHelper.

[C#]
        /// <summary>
/// Form Load event handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Load(object sender, EventArgs e)
{
m_globeControl = axGlobeControl1.Object as IGlobeControl;

//cast the GlobeViewUtil from the GlobeCamera
m_globeViewUtil = m_globeControl.GlobeCamera as IGlobeViewUtil;

//Start listening to globe display events.
((IGlobeDisplayEvents_Event)m_globeDisplay).AfterDraw += new
IGlobeDisplayEvents_AfterDrawEventHandler(OnAfterDraw);

}


/// <summary>
/// GlobeDisplay's AfterDraw event handler.
/// </summary>
/// <param name="pViewer"></param>
private void OnAfterDraw(ISceneViewer pViewer)
{
//AfterDraw event handler logic goes here.
}
总结:系统基本就搭建完毕,下面就可以一步的学习OpenGL在其中的使用!

你可能感兴趣的:(ArcEngine)