AFai

AFai
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年2月29日

摘要: 一年前在我拜读Lippman的《C# Primer》一作的时候,有一句话深深地激励了我。原话差不多是这么说的,“要想成为C#方面的专家,至少得要精通Framework中的1000个类”,很明显我离这个数值还相差甚远,这不,“亡羊补牢,犹未晚也”,今天就拿一个比较简单的Environment类开刀。 如果说我把一篇文章搞成了MSDN的样子没有太多意义,因此我会在保持MSDN内容权威性的基础上,结合Reflector以及自己的一些使用心得来一窥它的奥秘,权当自娱自乐。一、这个类是用来做什么的?Environment类主要是用来提供有关当前环境和平台的信息以及操作它们的方法。无法继承此类。二、E.. 阅读全文

posted @ 2012-02-29 14:51 阿Fai 阅读(495) 评论(0) 推荐(0) 编辑

2012年2月28日

摘要: 使用的是C#语言。在添加对GDAL库的引用后,开始使用GDAL库函数前,需要进行注册,这个步骤包括:1.使用using OSGeo.GDAL;来引用GDAL的命名空间,2.在程序中使用 Gdal.AllRegister();语句进行注册 GDAL库中打开影像文件非常简单,使用Gdal.Open(string path,Acess eAcess)即可。第一个参数为影像路径,第二个参数为权限,分只读和可写两种。该函数返回值为Dataset类型。 可以从该Dataset中获取到一些影像的基本信息,例如影像宽度和高度,波段数,坐标变换参数,坐标信息等 注:该函数获取到的Dataset中只包含... 阅读全文

posted @ 2012-02-28 21:33 阿Fai 阅读(1919) 评论(0) 推荐(0) 编辑

2012年2月27日

摘要: 首先,需要说明的是关于GDAL入门的一些知识,在李民录先生的博客http://blog.csdn.net/liminlu0314/article/list/1?viewmode=contents上已经有比较好的说明介绍了,在这里,我引用他的博文,在他的基础上,做一些符合自己尝试经历的修改。在这里,我使用源码编译出C#可以使用的dll静态文件。一、简单的编译1、简单的认识 首先进入GDAL的源代码目录,可以看到有几个sln为后缀的文件名,比如makegdal10.sln,makegdal80.sln,makegdal71.sln,makegdal90.sln 。这些文件是VisualS... 阅读全文

posted @ 2012-02-27 21:51 阿Fai 阅读(1922) 评论(0) 推荐(0) 编辑

2011年12月27日

摘要: 本文是整个系列文章的最后一篇,将创建一个完整的虚拟office应用程序(如图所示)来做为ending.1,在CCY457OpenGLView类中加入下述变量,用来保存office内各个物体的显示列表//DisplayListNamesGLuintm_SceneList;GLuintm_ComputerList;GLuintm_ChairList;GLuintm_BlindsList;GLuintm_MonitorList;GLuintm_BooksList;GLuintm_PhoneList;GLuintm_DoorList;2,创建房间内部场景//CreatetheDisplayListfo 阅读全文

posted @ 2011-12-27 09:33 阿Fai 阅读(359) 评论(0) 推荐(0) 编辑

摘要: 本文将介绍如何从Obj文件格式中创建3D对象,我们使用的是Nate Miller的obj格式加载类。This would be very useful to create large Virtual Reality applications as we could make use of the readily available 3D model files or make use of modeling tools to create these models and load them instead of creating them programatically. The .obj 阅读全文

posted @ 2011-12-27 09:32 阿Fai 阅读(358) 评论(0) 推荐(0) 编辑

摘要: ShadowsConceptually drawing a shadow is quite simple. A shadow is produced when an object keeps light from a source from striking some object or surface behind the object, casting the shadow. The area on the shadowed object's surface outlined by the object casting the shadow appears dark. We can 阅读全文

posted @ 2011-12-27 09:31 阿Fai 阅读(254) 评论(0) 推荐(0) 编辑

摘要: ReflectionsAdding reflections to a program too can improve its realism to a great extent. Here we'll look at a simple method to create reflection where we simply redraw the object with an appropriate transformation and make the surface in between translucent. This creates an effective illusion o 阅读全文

posted @ 2011-12-27 09:31 阿Fai 阅读(305) 评论(0) 推荐(0) 编辑

摘要: 本文在第11篇文章的基础上,为其加入显示各种二次曲面的代码;QuadricsEvery quadric has a few settings associated with it. We have to create a quadric first and then customize its settings to render the shape we want. ThegluNewQuadricfunction creates a state variable that describes the current drawing style, orientation, lighting 阅读全文

posted @ 2011-12-27 09:30 阿Fai 阅读(208) 评论(0) 推荐(0) 编辑

摘要: SelectionSelectionis a powerful feature of OpenGL that allows you click at some position of the OpenGL window using the mouse and determine which of your objects lie beneath it. The act of selecting a specific object is calledPicking. With OpenGL's selection feature, we can specify a viewing vol 阅读全文

posted @ 2011-12-27 09:30 阿Fai 阅读(291) 评论(0) 推荐(0) 编辑

摘要: 本文对第11篇文章进行修改,使用显示列表来存储渲染命令。显示列表OpenGL provides a facility to create a preprocessed set of OpenGL commands called a display list. Creating a display list is a straight forward process. We just have to delimit the display list code with glNewList and glEndList. The display list is named by an integer 阅读全文

posted @ 2011-12-27 09:29 阿Fai 阅读(189) 评论(0) 推荐(0) 编辑