P-155 “Phoenix” Engine Update 3: Object Loading and Camera Movement
I have finished implementing Object Loading support (with .obj files) to the engine. I have not yet implemented texturing, or any kind of optimisations, but object loading is done.
I have also implemented camera movement. This was relatively simple, but what complicated it a little is that OpenGL is fundamentally different from a ready-made games engine, in the sense that OpenGL only renders to the screen, it does not store objects or information about objects.
What I was trying to do was implement code to move the camera in the world, the same way you would in a high-level games engine. However, I was thinking of the “Camera” as an object in the world, and OpenGL doesn’t have this kind of structure. So, in OpenGL, you actually don’t move the camera, you move the world.
In each render pass, you adjust the position of everything to be rendered with respect to the new transform of the viewer, so, if the player moves 10 units back, instead of moving a camera object 10 units back, you move all of the objects to be rendered 10 units forward. The same is true with rotation. This is essentially the same concept that I came across when solving the 32-bit precision problem with very long view distances.
The next step is to implement text rendering support, since this is obviously a vital feature for any game or project.
