Technologies

View Frustum Culling:

This is done by retrieving the modelview matrix and projection matrix. From these we calculate the far, near, top, bottom, left, and right planes using cross product, this gives us the view volume. We then find the difference of the dot product between an object's center and each plane and the object's radius (given by computing an object's center and determining the object's furthest point from that center). If the radius is greater than the distance from the center to the plane, we know the object isn't in the view volume. All models are used to test for culling except for the robot model because he is always in frame.

Bounding Sphere Hierarchy:

This is done by dividing our map into 16 equal different parts (but this subdivision can be more finite through a simple value change). In each subdivision we determine what objects belong to it. With these subdivisions we are able to more efficiently detect collisions as well as efficiently detect which objects need to be culled quicker. This is done by first detecting which of the 4 bigger Sphere's we are looking/checking collision with, and then use that sphere to check it's subdivisions to do the same thing until we get down to checking culling/collision with the objects themselves. The bounding sphere hierarchy only applies to our static positioned objects (car, barn, house, trees, sunflower, wind mill, and hay stack).

Collision:

This is done through bounding spheres. Sphere collision, due to it's simplicity, was the most efficient and effective way to go about our collision detection. To detect the collision between two objects we would find the distance from two objects centers, and if this value was less than the maximum distance that 2 objects could be without touching (obj1's radius + obj2's radius) then we would determine the two objects were colliding.

Free Form Deformation:

Using free form deformation, in combination with a sine wave function, we were able to give out trees, sunflowers, and hey stacks their unique movement through out the game, making the player fee as if the have entered a new world, much different that this world.

sine

Particle systems:

Particle systems are a way to have objects move around freely based off given forces. This allows much more randomness than doing something like linear interpolating or other methods of movement. The programmer doesn't have to tell it what to do, he gives the objects an initial position, velocity, and acceleration and they particle then start and react to the forces provided in the X, Y an Z directions. In the case of our game, the Animals are given an initial velocity and position and they are attracted to the robot with an attraction force. The explosion and "bleeding" affects of the robot shooting the animals are also done with a particle system, but using different forces and initial position. They are given the position of the animal shot, and a velocity and force that simulates and explosion.

Sounds:

After reaserching sound liblaries like OpenAL and FMOD, we decided to use PlaySound(..., ... , ... ) because it can produce the same effects in our situation, but simpler. PlaySound is a C++ function. For animal sounds we have a distance check and to make the sounds more real by not calling the function everytime the robot sees an animal we have random number generator to make sure animals do not continuously make sounds. Sound is also used in to make the shooting more real.

Cartoon Shader:

Using GLSL we were able to create a cartoon shading effect. By using the normal vector and light vector of the model polygons, we calculated an intensity value and scaled the current color depending on the intensity. In order to create the outline we used OpenGL front-face culling along with a wireframe to create a simple and effective cartoon outline.

Animals:

The animals bounce off objects they collide with as well as other animals by using bounding spheres, which is when you represent each object as a sphere to simplify collision checks. The animals will jump around based on a sin wave and stretch and squish this is done with scaling. The animals will bleed butterflies when shot, this is done with a particle system when collision is detected with a bullet.

Fog:

openGL fog was added into the game to help prevent a popping effect by having objects dissapear into the fog while they are being clipped and removed from the drawing plane.

 

Home | How to Play | Download | Technologies | References | Team