Random Sphere Collision w. Planes and Spheres

 

Alexander Scott

CPE 471 Winter 2006

Zoë Wood

 

Project Description:

      This is a program that simulates the interaction of spheres between other spheres as well as planes. I have created an artificial world that is a cube that the spheres interact with and are bound too. The spheres bounce of the walls of the world and assume a new direction of travel. When the spheres collide with other spheres there are a number of different things that can occur. The spheres can bounce off of each other, become a larger sphere, and finally align themselves and move around in the world with the same velocity and direction. The user is also allowed to control the speed, size and direction of the balls. They are also allowed to create more spheres, and condense the number of spheres down by allowing the spheres to absorb each other. The program also has a texture mapped world, as well as randomly textured mapped fractals for each sphere (seven in all).

 

Users Guide:

            Along with the use of menus via the mouse to control program interaction, the user is also allowed to do so with the use of the keyboard. Here are the keys to control all of the program functionality;

 

 

              Press 'w' to move camera/view forward in the world.

              Press 's' to move camera/view back in the world.

              Press 'a' to move camera/view left in the world.

              Press 'd' to move camera/view right in the world.

 

              Press 'g' to split each ball in two, doubling the amount of balls.

              Press 'c' to bring all balls to the center of the world.

              Press 'z' to slow down the speed of the balls.

              Press 'v' to increase the speed of the balls.

              Press 'q' to generate a new, random direction for each ball.

              Press 'b' to have balls bounce off each other.

              Press 'p' to have balls bounce absorb each other.

              Press 'o' to have balls allign themselves upon a collision.

              Press 'u' to grow the size of each ball.

              Press 'i' to shrink the size of each ball.

 

Sample Screen Shots

 

Picture 1. The balls randomly moving around in the world

 

 

 

Picture 2. The balls on their way to the center of the world after user keystroke of ‘c’

 

 

Picture3. The console to allow for the user to use the keyboard after hitting ‘h’

 

 

 

Picture4. The spheres moving around in the world after being aligned

 

 

Resources

 

 

A very useful site for downloading fractal pictures for the spheres

www.wussu.com

 

A helpful site that describes how to detect sphere to sphere collision as well as plane collisions

          http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=30

 

A good site for an openGL tutorial

          http://www.eecs.tulane.edu/www/Terry/OpenGL/Introduction.html