Used OpenGL to make a graphics engine with freecam movement, a scene graph, and the ability to read and texture advanced wavefront objs.
I had to:
Understand core graphics prinicples and maths.
Know how .obj data is stored and how it can be read.
Use matricies to have relative transformation and children.
Abstract logic into components that can be gathered in a gameobject
Github: https://github.com/barter127/HelloGLÂ (You need to build in x86!!!!!)
Model Loading required careful planning to handle many edge cases and models with multiple textures. Edge cases were handled by checking each line for the keyterms "v", "vt", "vn", or "f" and adding them to a std::vector. Accomodating for multiple textures was a bit harder and was done by abstracting parts of the model with a single texture into a mesh class which saved time as setting the pipeline state only needed to be done once for each mesh draw. Alongside this, a .mtl loader was made that automatically created a material class with the read data and applied it to the mesh.
Each GameObject class held a pointer to a parent object and had an array or pointers to child objects. Each draw call, if the child array wasn't empty it would recursively run each childs render function applying the matrix transformation. The parents dirty flag was passed as a parameter to the children to prevent unnessecary matrix multiplication.
Double Buffer to hide drawing and prevent screen tearing.
Dirty Flag/Bit reduced redundant matrix multiplication by setting a bool when the child transform is out of sync from the parent.
Component pattern use to divide gameobject behaviour into components to allow for logic reuse.
Update loop pattern handles all per frame behaviour and input detection