基于OpenGL的银杏树三维形态构建仿真模型设计与实现毕业论文

 2021-04-10 11:04

摘 要

近年来,随着计算机科学技术的不断发展,计算机三维仿真技术已经逐渐成熟,作为最直观的计算机显示方式之一,已经广泛的应用到教育,科研,娱乐等领域中,利用计算机实现对于现实系统的三维仿真研究不仅方便,灵活,而且也是经济的,可以最大限度的展现现实世界,因此计算机三维仿真在仿真技术中占有重要作用。作为计算机三维仿真技术的应用之一,银杏树三维仿真为银杏树的科学研究,展示提供了非常直观的视觉效果,最大限度的发挥了银杏树作为植物活化石的作用,因此对银杏树进行三维仿真具有重大意义。

本课题利用OpenGL函数接口,在Visual C 平台下对银杏树进行三维仿真,首先要建立银杏树的三维模型,利用OpenGL函数库来建立银杏树的树干,树枝,树叶等三维部件,并进行表面纹理贴图,最后在运用一定的算法将所有的部件进行组合来形成一棵银杏树的三维模型。其次要模拟银杏树所在的真实环境的三维模型:首先要建立一个视角模型,用来创建一个观察者所在的方位以及视距和视觉方位,其次太阳和月亮的三维模型,采用光照模型来模拟太阳以及月亮发出的光照,模拟出环境光,散射光等效果,最终实现月落日出的真实场景,然后要建立大风天气的三维模型,采用一定的算法让银杏树的树枝树叶在一定的角度弯曲这样来模拟大风天气对银杏树造成的效果,这样可以通过对银杏树的树枝树叶的摇摆姿态来实现对大风的真实场景,最后要建立大雨天气的三维模型,采用粒子系统模型来实现对大雨天气的模拟,同时结合大风天气的模型,最终实现对于银杏树在大风大雨天气中的环境模拟。在最后还要模拟银杏树随着季节的变化而产生的树叶变黄等效果,以此来模拟在步入金秋时节的银杏树的三维仿真。

关键字:OpenGL ,仿真,光照模型,视角模型,粒子系统,三维可视化,银杏树,模型,纹理

Abstract

In recent years, with the continuous development of computer science and technology, three-dimensional computer simulation technology has matured, as the one of the most intuitive way in computer display,It has been widely used in education, research, entertainment and other fields, using the computer systems to achieve the real. Three-dimensional simulation is not only convenient, flexible, but also the economy, It can maximize the present real world, so three-dimensional computer simulation in the simulation technology plays an important role. As the one of the way in three-dimensional Computer simulation technology application. The three-dimensional simulation of ginkgo tree provides a very intuitive display of visual effects to scientific research of ginkgo tree. Taking the most effect in ginkgo tree which the role as a living fossil paints, so three-dimensional simulation of the ginkgo tree has the great significance.

This subject is using the OpenGL function interfaces. Simulating the three-dimensional model of the ginkgo tree in the Visual C platform. At first, We must to build the three-dimensional model for ginkgo tree, Using OpenGL library to create a ginkgo tree trunks, branches, leaves and other three-dimensional components, And texture mapping on the surface, At last take the algorithm to combine all the components to form the three-dimensional model of a ginkgo tree. Second, we must simulate the real environment where the ginkgo tree: first to establish a perspective model to create a position where the observer and the line of sight and visual orientation, Second is to create three-dimensional model of the sun and the moon, using lighting model to simulate the sun and the moon light given to simulate the ambient light, scattered light and other effects, and ultimately out of the real scene on the sunrise and sunset, Then we must to create the three-dimensional model of windy weather, Take the algorithm to make the leaves, branches bend in a certain angle to simulate the wind weather caused by the effect of ginkgo trees. which can realize the true scene of strong winds by sway posture of leaves and branches of ginkgo tree. Finally is create the three-dimensional model of heavy rain, using particle system model to achieve the simulation of heavy rain, combined with windy weather models, Ultimately to achieve the screen of ginkgo tree in heavy rain and windy environments. Finally we simulated the effect of leaves turn yellow with the season changed, In order to simulate the three-dimensional model of ginkgo tree in the fall.

目录

第一章 绪论 6

1.1 OpenGL简介 6

1.2 OpenGL特点及功能 6

1.3树木三维仿真研究现状 7

1.4 课题任务 8

第二章 OpenGL基本概念概述 3

2.1 数字图像基本概念 3

2.2 OpenGL模型基本概念 4

2.3 OpenGL工作原理 8

2.4 像素格式 8

2.5 绘图设备关联 10

第三章 OpenGL视图构建 11

3.1 窗口管理 11

3.2 视图变换 11

3.3 模型变换 12

3.4 投影变换 13

3.5 视口变换 15

第四章 纹理映射 16

4.1 导入图片 16

4.2 指定纹理 16

4.3纹理过滤 17

4.4分配纹理坐标 18

第五章 程序模块详细设计 19

5.1程序运行流程 19

5.2初始化及视图模型程序设计 19

5.3银杏树模型程序设计 20

5.4环境模型程序设计 21

5.5 OpenGL性能优化 26

5.6 程序运行效果 30

参考文献 33

绪论

1.1 OpenGL简介

OpenGL前身是SGI公司所开发的的IRIS GL图形函数库,SGI是一家久负盛名的公司,在计算机图形和动画领域处于业界领先的地位。IRIS GL最初是个2D图形函数库,后来逐渐演化为SGI的高端IRIS图形工作站所使用的3D编程API。后来,由于图形技术的发展,SGI对IRIS GL的一致性进行了改进和提高,使它逐渐发展成如今的OpenGL。在此期间,OpenGL得到了各大厂商的支持,从而使它成为一种广泛流行的三维图形标准。

OpenGL是图形硬件的一种软件接口。从本质上说,它是一个3D图形和模型库,它提供了一些预包装的功能,帮助开发人员编写功能强大的三维图形程序。OpenGL具有很高的可移植性,可以在多种操作系统平台上运行,例如各种版本的windows,UNIX/linux,Mac OS等,并且OpenGL具有非常快的渲染速度。如今,OpenGL已经广泛应用于游戏,医学影像,地理信息,气象模拟等领域,是高性能图形和交互性场景处理的工业标准。

1.2 OpenGL特点及功能

OpenGL是一个开放的三维图形软件包,它独立于窗口系统和操作系统,以它为基础开发的应用程序可以十分方便地在各种平台间移植;OpenGL可以与Visual C 紧密接口,可保证算法的正确性和可靠性;OpenGL使用简便,效率高。它具有七大功能:

您需要先支付 80元 才能查看全部内容!立即支付

课题毕业论文、开题报告、任务书、外文翻译、程序设计、图纸设计等资料可联系客服协助查找,优先添加企业微信。