I created this simulation because I enjoy playing basketball as a hobby. I thought it would've been interesting to create an application where you can simulate the shot of a player and continue doing the simulation. The goal of the project was to allow the player to specify a force to push the basketball towards the hoop. It would've been very similar to a shooting simulator.
The ball is the only object in the game that travels as a projectile. It follows a trajectory
and would eventually drop at some point due to gravity. The ball has a position, velocity, and
acceleration vector where the position is affected from velocity and gravity. This was the
hardest part for me because the ball was mainly traveling in a straight line and wouldn't
allow gravity to affect it. I had to do a lot of debugging to see the issue and scale the
values down to appropriate values. I ended up trying multiple variations of the kinematic equations
and eventually followed a trajectory webpage formula to calculate the positions.
The dummy, basketball hoops, and the bunny spectators in the back implement blinn-phong lighting
where a light source is provided and affects the color of everything else that's near. This was fairly
simple as I just followed the formula for Blinn-Phong.
The camera implemented a pitch and yaw system that allowed us to traverse the entire scene. You are able to travel around through the WASD keys while the mouse scroll functions rotates the camera.
The dummy is the main hierarchical model that I used. It made it easier for me to do translates and rotations relative
to each other.
Texture mapping wrapped a picture around an object to simulate realism for it. The ball, court, and dog were all
texture-mapped. However, the dog was the only object that had a good texture map since the ball and court had
multiple flaws.
A cubemap is a 3-D cube that encompasses the entire scene. It gives the scene a great background to work with
and provides a good sense of realism.
Trajectory Calculator and Formula
CSC471 Projects and Labs