Dynamic Cubemap + Particle Systems Demo. ---------------------------------------------------------------------------- Team Members: Adrian Cheng Jose Luis Ramirez Herran CSCI-E234 Introduction to Computer Graphics with OpenGL. Spring 2007 ---------------------------------------------------------------------------- Introduction: This demo demonstrates two widely used techniques in game systems. - Dynamic cubemap is a graphics technique that maps the surrounding environment onto an object, creating a "mirror" like effect. - Particle systems is a widely used technique to create realistic physics system such as fire, rain, water fountain. ---------------------------------------------------------------------------- Installation: There is a zip file called application.zip which is the stand alone application unzip all the files to a folder of your choice and double click on the executable. There is the source code that you can run in Visual Studio 2005. unzip all the files to a folder of your choice open the Solution and run the program. ---------------------------------------------------------------------------- Controls: The only control in this demo is the mouse cursor. Pressing down the mouse button and move around allows the camera angle to rotate around. ---------------------------------------------------------------------------- Source Files: FX_Engine.h In this file you'll find the definition of the class FX_Engine that implements a paticle engine as an example use of the class ParticleEngine. Particle.h Defines the class QdParticle with all the attributes and functions assigned to a particle and it behavior qd.h define a serie of macro functions and structures for the particle system. FX_Engine.cpp This file includes the implementation of all the methods and claculations for the particle system and the laws of physics for each particle. main.cpp The master program control file. Particle.cpp Defines the functions and parameters that control the behavior of each particle. Our Project have the folowing objectives: 1. To build a particle system to simulate weather effects to be used in 3D games or for s cientific visualization of natural phenomena. The code is used then inside a dynamic cube map environment. 2. To demonstrate the graphical effect that a dynamic cubemap can create. ------------------------------------- The Demo: There are a few elements in this demo - main object - teapot - skybox - cubemap wrapped around the teapot - bouncing ball - particles simulating water fountain ------------------------------------- Details: The particle engine consist of an encapsulation of the system of particles in the class FX_Engine. The definition of a particle and the functions to rule its behavior are defined in the class particle. To use the engine you instantiate an FX_Engine object in the main program, you initialize the engine to perform in between certain limits and with certain number of particles. Then you call the draw functio to load the effect into the scene. The main program works like this: display() { // setup viewport to facing the teapot // bind to cubemap texture // draw the teapot // bind to 2D texture // draw the scene // glutSwapBuffers() // everything before here is displayed on screen // everything after here is not. // do the offscreen updates } The scene includes: { // draw the skybox // draw the 6 2D textures composing the cubemap // draw the ball // draw the particle systems } The offscreen updates include: { // set the read buffer to back buffer // loop from face 0 to face 5 { // set the viewport so that the eye position is // at the center of the teapot and the view direction // is the 6 orthogonal directions (positive/negative xyz) // draw the scene // copy the contents of the back buffer to the // 6 faces of the cubemap // copy the contents of the back buffer to the // 6 2D textures representing the faces of the cubemap } // reset the viewport } Useful Resources with credits 1. Visual computing: Geometry, graphics, and vision. Frank Nielsen. Charles River Media. 2005. 2. http://www.codeproject.com/opengl/ParticleEngine.asp 3. http://nehe.gamedev.net/data/articles/article.asp?article=06 4. Computer Animation. Algorithms and techniques. Rick Parent. Morgan Kaufmann Publishers. 2002. 5. Killer Game Programming in Java . Dr. Andrew Davison 6. Simulation of Cloud Dynamics on Graphics Hardware 7. Mark J. Harris William V. Baxter III Thorsten Scheuermann† Anselmo Lastra. Department of Computer Science, University of North Carolina at Chapel Hill, North Carolina, USA 8. Paper: NEAT Particles: Design, Representation, and Animation of Particle System Effects. Authors: Erin Hastings, Ratan Guha, and Kenneth O. Stanley. Published in: IEEE Symposium on Computational Intelligence and Games (CIG'07)