教学单位 计算机科学系
学生学号 061712412
本科毕业论文(设
计)
题 目 基于
OpenGL
的游戏软件设计
学生姓名 夏 德 雄
专业名称 计算机科学与技术专业
指导教师 李 志 敏
2008
年
3
月
18
日
基于 OpenGL 的游戏软件设计
摘要:
本软件是基于 OpenGL,使用计算机图形学相关知识,在 VC++环境下
实现的 3D 游戏软件系统。该软件集可操作性,实用性,趣味性于一体,通过
美观逼真的场景,丰富的色彩及友好的界面以实现各种算法。本课题讲述了
OpenGL 的相关知识,并按游戏制作的步骤一步一步完成。
课题中程序涉及到以下几个模块:OpenGL 的程序框架;OpenGL 的
基本图形;OpenGL 的组合图形;游戏场景生成;OpenGL 中的文字显示;特
殊平面_树木;显示 3D 模型;3D 动画模型;射击、爆炸;碰撞检测;游戏进度
保存;3D 场景编辑等。
关键词: OpenGL; 3D 动画模型; 随机地面; 射击与爆炸; 碰撞检测;
I
Design Game Software Based on OpenGL
Abstract:
We present a 3D game system based on OpenGL which runs under VC++.It
gathers the maneuverability, practicability and interesting together and gives us a
good-looking and lifelike scene. It also gives us abundant of color and friendly
interface. So we can implement kinds of algorithms by the software. This design
guides us how to develop game software.
This paper contains modules as follows: the frame of program of OpenGL; basic
graphics of OpenGL; combination graphics on OpenGL; creating the sky and terra;
showing words in OpenGL; special plain and tree; showing the 3D model; 3Dcartoon-
model; shooting and exploding; collision check; saving the schedule; the scene
compilation of OpenGL
Keywords: OpenGL; 3Dcartoon-model; random-ground; shooting and exploding;
collision check
II
III
目 录
1 引言..................................................................................................1
1.1 概述..............................................................................................1
1.1.1 本课题的研究目的及意义....................................................1
1.1.2 本课题国内外研究现状.......................................................1
1.2 需求分析........................................................................................2
1.3 开发工具选择..................................................................................3
2 什么是 OpenGL.................................................................................3
2.1 OpenGL 的特点..............................................................................3
2.2 OpenGL 的基本原理........................................................................4
3 OpenGL 的图形生成...........................................................................5
3.1 基本图形的绘制方法.........................................................................6
3.2 窗口模式下的像素绘制......................................................................7
3.3 复杂图形的生成...............................................................................8
3.3.1 模型骨架构成....................................................................8
3.3.2 外观真实化.......................................................................8
4 场景生成与渲染..................................................................................9
4.1 摄像机原理和构成............................................................................9
4.2 地面生成方法................................................................................10
4.3 天空生成方法................................................................................10
4.4 树木草地生成方法..........................................................................10
5 OpenGL 显文字...............................................................................11
6 模型与动画的生成.............................................................................12
6.1 三维模型绘制及读入:...................................................................12
6.2 动画模型的实现.............................................................................13
6.2.1 使用双缓存实现动画.........................................................13
6.2.2 后备缓冲模型的算法实现..................................................14
6.2.3 窗口模式下的游戏动画.....................................................15
6.3 特殊动画模型................................................................................16
7 射击爆炸与碰撞检测.........................................................................16
7.1 爆炸、粒子...................................................................................17
7.2 碰撞及检测...................................................................................18
7.2.1 通过范围检测碰撞...........................................................18
7.2.2 通过颜色检测碰撞...........................................................19
7.2.3 通过行进路线检测碰撞.....................................................20
8 游戏剧情规划...................................................................................21
8.1 游戏主题的确立.............................................................................21
8.2 剧情的发展过程.............................................................................21
8.3 主要人物的突出.............................................................................22
8.4 悬念的安排...................................................................................22
8.5 节奏与风格的选取..........................................................................22
9 游戏保存.........................................................................................23
9.1 进度保存......................................................................................23
i
- 1
- 2
- 3
前往页