OBJ MODEL VIEWER



This was a project for a university assignment in which we were tasked with creating a model viewer/loader using C++ and OpenGL that could do the following:

- Support loading 3D .OBJ models.
- Support OBJ .MTL material files.
- Event-system to handle window resizing events.
- Render a skybox.
- The camera that renders the scene must be able to be moved around the scene by the user.



When no .mtl (material) file is supplied to the renderer, a default material is supplied to the program.

This is a set of default values that tells the shader program what the model should look like, how it should be lit, and what colour it should be.

To add more interactivity to the model viewer, I added a feature that allows the user to modify the default material values to any setting they choose, as seen above.



When the material file is loaded sometimes it may specify that textures are to be used on the model.

When this is the case the program adds to the material that is being read from that a texture should be used whenever a mesh using that material is rendered.

The texture data is then passed to the shader which then applies that colour to the current mesh being rendered.