1.1 General Objectives
Our Project have the following objectives:
A. To build a particle system and demonstrate how to simulate weather effects to be used in 3D games or for scientific visualization of natural phenomena.
B. To demonstrate the graphical effect that a dynamic cubemap can create.
1.2 Specific graphics-related goals of the project
Our Project demostrates the use of the following graphics capabilities of OpenGL:
- Dynamic cubemap
- Particle systems
- Physics Simulation
- Collision detection
- Texture Mapping
- Animation
- Primitive Solid Models
- Vertex and Fragment shaders
-------------------------------------
1.3 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
-------------------------------------
1.4 Details:
1.4.1 Particle systems
Particle systems provide a powerful framework for animating numerous similar elementary “objects” at the same time. Those objects are called particles. Using a lot of particles with simple physics allow us to mode complex phenomena such as:
- Fireworks
- Waterfalls
- Smoke
- Fire
- Flocking
- Clothes, etc.
The particle engine consist of an class that encapsulates the system of particles: 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 file, you initialize the engine to perform in between certain limits and with certain number of particles. Then you call the draw function to load the effect into the scene.
1.4.2 dynamic cube mapping
The technique used here model reflections in a complex environmment without resorting to ray-tracing. The fundamental idea behind environment mapping is that we use the reflection vector from the surface of an object to look up the reflection color from an "environment" that is stored ina texture map. If environment mapping is done properly, the results looks as if the object being rendered is shiny and is reflecting its environment.
A cube map is a texture that has six 2D textures that are organized to represent the faces of a cube. Cube maps are accessed with three texture coordinates that are treated as a direction vector emanating from the center of the cube. The cube map faces are differentiated by the sing along each of the three major axis directions like in the following figure.

Graphics hardware can use the three texture coordinates as a direction vector and automatically select the proper face and return a texel value where the direction vector intersects the face of the cube map.
To look around the model and see the dynamic cube map working, you just have to click the mouse somewhere in the screen, hold it while you move it to rotate the model.
1.5 Overview of the main program
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
}
|