Discovering the World of Graphics Programming
My Childhood Curiosity in 3D Game Graphics
For as long as I can remember, I have been fascinated by the programming involved in the creation of modern 3D games. In recent years, I have gained expertise in deep learning, classical machine learning, and computer vision, but these have not satisfied my childhood curiosity. I still recall owning my first PlayStation console in 2006 and being amazed by the realism of the 3D graphics in games like God of War, Call of Duty, EA Sports, and Pro Evolution Soccer.
The Process of Creating a 3D Object
To satisfy my curiosity, I took a course on Visual Computing and Computer Graphics. I went from rendering a single triangle using Rust, OpenGL, and GLSL to modeling a helicopter. The triangle is considered the "Hello World" of graphics programming because complex 3D scenes are often just made up of vertices from multiple connected triangles. To be specific, the attached terrain image was created with 93,287 triangles, and the helicopter's rotor, body, and door were made with a total of 74,474 triangles.
Recommended by LinkedIn
Animating the Helicopter
The most exciting part was animating the helicopter. To animate the helicopter, I used a series of affine transformations, such as translations and rotations, to move the object in 3D space. I also animated the helicopter's door and made sure it opens and closes smoothly, without sliding endlessly. Assembling the helicopter was challenging, especially getting the body and tail rotor to spin on the correct axis without rotating out of control. A composite transformation was used to resolve this issue. The rotor was translated to the helicopter's frame of reference, rotated about the reference axis, and then translated back to its original position. The most important concept used to implement all these relative motions is the "Scene Node". This process was facilitated by using tools such as OpenGL and Rust, as well as concepts like the Model View Projection Matrix, vertex shaders, and fragment shaders.
Applying These Skills to Gaming
This is a high-level overview of graphics programming. Some of the useful tools and concepts include Affine Transformation, the Illumination Model, creating 3D models in Blender, OpenGL, and Rust, the Model View Projection Matrix, Surface Normal Vector, Vertex Shader, Fragment Shader, Buffer Array, Scene Node, etc.
The final result is the creation and control of a 3D helicopter. This could be scaled up to a full-fledged video game with health status or score bars attached. For example, a simple gaming scenario like shooting down a helicopter could be modeled by creating a gun and bullet object, and a counter could be incremented based on the overlapping of the bullet and helicopter objects. The helicopter could be destroyed once the counter reaches a specific threshold.
Final Thoughts
The goal of this write-up is not to educate, as I have only scratched the surface of graphics programming, but to spark your curiosity and motivate you to dive deeper into this unique programming world. If this post has inspired you to explore graphics programming, then I encourage you to do so! Not only can it lead to a rewarding career, but it can also be a fun and entertaining hobby.