文件名称:OpenGL入门学习.pdf
文件大小:920KB
文件格式:PDF
更新时间:2013-04-10 08:48:49
OpenGL
一、第一个OPENGL程序...................................................................................................................4 1.1、OPENGL的优点..........................................................................................................................4 1.2、OPENGL的安装..........................................................................................................................4 1.3、第一个OPENGL程序.................................................................................................................5 二、点、直线和多边形..........................................................................................................................8 2.1、点、直线和多边形.....................................................................................................................8 2.2、在OPENGL中指定顶点.............................................................................................................8 2.3、绘制曲线....................................................................................................................................9 三、绘制几何图形的细节....................................................................................................................14 3.1、关于点......................................................................................................................................14 3.2、关于直线..................................................................................................................................14 3.3、关于多边形...............................................................................................................................15 四、颜色的选择...................................................................................................................................20 4.1、RGBA颜色...............................................................................................................................20 4.2、索引颜色..................................................................................................................................21 4.3、指定清除屏幕用的颜色...........................................................................................................22 4.4、指定着色模型...........................................................................................................................23 五、 三维变换.....................................................................................................................................25 5.1、模型变换和视图变换...............................................................................................................25 5.2、投影变换..................................................................................................................................26 5.3、视口变换..................................................................................................................................28 5.4、操作矩阵堆栈...........................................................................................................................29 5.5、综合举例..................................................................................................................................29 六、 动画制作.....................................................................................................................................33 6.1、双缓冲技术...............................................................................................................................33 6.2、实现连续动画...........................................................................................................................34 6.3、垂直同步..................................................................................................................................35 6.4、计算帧速..................................................................................................................................36 七、光照...............................................................................................................................................40 7.1、建立光照模型...........................................................................................................................40 7.2、法线向量..................................................................................................................................41 7.3、控制光源..................................................................................................................................41 7.4、控制材质..................................................................................................................................43 7.5、选择光照模型...........................................................................................................................43 7.6、示例程序..................................................................................................................................44 八、 显示列表.....................................................................................................................................48 8.1、分配显示列表编号...................................................................................................................48 8.2、创建显示列表...........................................................................................................................49 8.3、调用显示列表...........................................................................................................................49 8.4、销毁显示列表...........................................................................................................................50 九、 混合.............................................................................................................................................56 9.1、源因子和目标因子...................................................................................................................56 9.2、二维图形混合举例...................................................................................................................57 9.3、实现三维混合...........................................................................................................................58 十、像素操作.......................................................................................................................................63 10.1、BMP文件格式简单介绍........................................................................................................63 10.2、简单的OPENGL像素操作.....................................................................................................64 10.3、GLREADPIXELS的用法和举例................................................................................................64 10.4、GLDRAWPIXELS的用法和举例..............................................................................................68 10.5、GLCOPYPIXELS的用法和举例................................................................................................70 十一、 纹理.........................................................................................................................................73 11.1、启用纹理和载入纹理.............................................................................................................74 11.2、纹理坐标................................................................................................................................75 11.3、纹理参数................................................................................................................................76 11.4、纹理对象................................................................................................................................77 11.5、示例程序................................................................................................................................79 十二、 测试操作.................................................................................................................................87 12.1、剪裁测试................................................................................................................................87 12.2、ALPHA测试.............................................................................................................................88 12.3、模板测试................................................................................................................................92 12.4、深度测试................................................................................................................................97 十三、 OPENGL的状态....................................................................................................................99 13.1、取得OPENGL的当前状态...................................................................................................100 13.2、设置OPENGL状态...............................................................................................................101 13.3、OPENGL工作流程................................................................................................................101 十四、 OPENGL的版本和OPENGL的扩展...............................................................................104 14.1、OPENGL的版本....................................................................................................................104 14.2、OPENGL的扩展....................................................................................................................106 14.3、工具软件...............................................................................................................................110 十五、OPENGL的演进....................................................................................................................112 15.1、从原始一点的办法开始.......................................................................................................112 15.2、顶点数组...............................................................................................................................115 15.3、顶点缓冲区对象...................................................................................................................118 十六、显示文字.................................................................................................................................122 16.1、OPENGL版的“HELLO, WORLD!”.........................................................................................122 16.2、指定字体...............................................................................................................................124 16.3、显示中文...............................................................................................................................126 16.4、纹理字体...............................................................................................................................128 16.5、应用纹理字体的实例:飘动的旗帜...................................................................................132 16.6、缓冲机制...............................................................................................................................137 16.7、轮廓字体...............................................................................................................................141