【正文】
作為編程工具實現(xiàn)以上代碼。 關鍵字: OpenGL,粒子系統(tǒng),瀑布場景模擬,紋理映射 II Waterfall Scene Simulation Based on OpenGL and Particle System Abstract With the rapid development of puter science and technology, simulation of nature scenes using Computer Graphics bee a new hot topic. With such growing attention, Computer Graphics gradually is applied to more and more fields, such as animation, advertisements, movies, video games and designs of art. It’s a very effective and lifelike to simulate a waterfall scene with particle system. With particle’s special and tiny features, it can be used to simulate most of the irregular objects and random movements, which just reflects on the nature of nature. This paper describes a waterfall scene simulation based on OpenGL and particle system. In order to make the visual effect of simulation realistic, relevant knowledge including texture mapping, lighting, color and visions of OpenGL are utilized in this system. First of all, analysis of the characteristics is needed to build a model of a real waterfall. The trajectory of the waterfall can be reconstructed in the puter with certain knowledge of physics and mathematics. The trajectory of the waterfall model can be described as follows: the water rush down, and then it bounce back on the encounter of an obstacle, following a parabolic motion before it reach the ground at last. Next, define the attributes of particles based on the implementation principles of the particle system. Construct a sphere with quadratic surface and finish the texture mapping and color fusion. Afterwards, to make the waterfall lifelike, use the correlation functions of OpenGL to realize some features like multiangle rotation, mouse movement, atomization, color transformation, music playing, text display and so on. Last but not least, Visual C++ is chosen as the experiment platform. According to experiment results, it’s feasible and satisfying to simulate a waterfall scene with OpenGL and particle system on puters. Key Words: OpenGL, Particle System, Simulation of Waterfall, Texture Mapping III 目 錄 第 1 章 緒論 ................................................................................................................................... 1 課題背景 ........................................................................................................................... 1 研究意義 ............................................................................................................................ 1 研究內容 ............................................................................................................................ 2 論文結構 ............................................................................................................................ 2 第 2 章 相關技術介紹 ................................................................................................................... 3 OpenGL 技術 ..................................................................................................................... 3 OpenGL 基本操作 ................................................................................................... 3 OpenGL 開發(fā)庫 ....................................................................................................... 3 OpenGL 函數(shù) ........................................................................................................... 3 OpenGL 應用環(huán)境 ................................................................................................... 4 紋理映射 ............................................................................................................................ 4 色彩融合 ............................................................................................................................ 4 粒子系統(tǒng)實 現(xiàn)步驟技術 .................................................................................................... 5 第 3 章 瀑布系統(tǒng)的設計 ............................................................................................................... 6 系統(tǒng)大致框架 .................................................................................................................... 6 瀑布模型的定義 ................................................................................................................ 7 瀑布粒子的生成 ................................................................................................................ 7 瀑布粒子的更新與運動 .................................................................................................... 7 瀑布粒子的消亡 ................................................................................................................ 8 瀑布粒子的繪制 ................................................................................................................ 8 第 4 章 瀑布模擬系統(tǒng)的實現(xiàn) ....................................................................................................... 9 瀑布模型實現(xiàn) .................................................................................................................... 9 瀑布粒子屬性定義及初始化 .................................................................................. 9 瀑布粒子生成實現(xiàn) ................................................................................................ 10 瀑布粒子運動、更新、消亡實現(xiàn) ........................................................................ 10 瀑布粒子繪制實現(xiàn) ................................................................................................ 11 鼠標、鍵盤交互 .............................................................................................................. 12 旋轉交互 ............................................................................................................... 12 霧化控制 ............................................................................................................... 13 文字顯示 ....................