About The Program

I wanted to make a simple car driving simulation that followed some point-based system. I later decided to implement the particle system in what I believe to be an ingenious way involving crashing the vehicle. This would lead to the goal of the game to be trying to hit all four buildings, which in terms lights them on fire to earn the worse driver award. I believe I gotta the basics of what is need for a simple driving simulation. I was mainly keen on the driving experience and collison interactions for this project.

Computer Graphic Technologies

  • Blinn-Phong Shading (Texture & Non-Texture).
  • First-Person Fly-By Camera.
  • Texturing (Skybox, Vehicle).
  • Bounding Box Collision Detection (All Objects).
  • Particle System (Fire effect).
  • Basic Vehicle Velocity / Acceleration Physics
  • Basic Vehicle Driving Controls

Program Controls

  • First-Person Fly-By Camera - WASD & Mouse.
  • Car Movement - Arrow Keys.
  • ESC - Quit.

Reference and Info Links

Video Demonstration

Collision Detection

To achieve collision detection, I created a bounding box around the objects using the min and max values acquired from the shape class type. I constructed arrays to contain these values and used a function to simulate the intersection of the two bounding boxes. This function simply returning a boolean if the boxes intersected. An intersection would lead to an opposing multiplier onto the current vehicle's acceleration, simulating getting bounced away. This method is called AABB to AABB

Car Movement

Car controls were kept quite simple. I used a global variable for rotation that would change when the left and right arrow keys were pressed. Model translation to get the vehicle moving in the direction it is facing was done with some simple trigonometry. The vehicle has an acceleration factor which increases when the up and down keys are pressed. Constant negative acceleration is placed on which current acceleration is occuring until reaching zero. When at zero acceleration, The user cannot steer the vehicle simulating real-world driving mechanics. So in short, the vehicle speeds up when holding the acceleration arros (up and down) and will slow down to a stop if you don't. Car having inability to steer unless moving and finally collisions affect this acceleration as well.

Implementing previous projects' functionalities

I reused the camera mechanics from lab 7 for my first-person fly-by camera. I just wanted to include this to let people look around the world. The particle system from lab 9 has been used to act as fire. When the vehicle hits one of the buildings, the house changes to a red color and red particles / fire is activated. This represents the driver lighting the house on fire due to crashing into it. I as well included a skybox to further emphasize the night theme of the game / program.

Additional Photos