I designed this program in the fall of 2022 (my sophomore year) as part of my final project in Fundamentals of Computing. I used a gfx library provided to my class by our instructor. I implemented matrix math in accordance with perspective math equations I found on Wikipedia to create a simple 3D projection algorithm. I showcased the algorithm with a simple cube game.
Getting the first projection to work was the hardest step. The math was not difficult to implement, but the difficulties of C were an added obstacle. Because I was dealing with matrices of many different sizes, it was important to write helper functions that could work on any matrix--I used pointer arithmetic to solve this problem.
After validating that the individual functions worked, debugging the projections consisted mainly of trial and error. The perspective matrices took a number of different inputs (angles, distances, radii, etc.).
Finally, after creating a function that made a simple cube, it was simple to build a 3D course with a player and collectible coins using a 2D array. The game setup function looped through the array and placed a cube of corresponding color (i.e. gold for coins, white for player) depending on the value in the array.