This is a Mesh Loader (C++ based application) designed to load and visualize 3D objects. It utilizes modern OpenGL and SDL2 to render the mesh on the screen. It provides wired and shaded mode.
- OpenGL Integration: Uses modern OpenGL for rendering.
- Shader Support: Dynamic shader loading and compiling.
- Object Loading: Support for loading 3D objects from
.obj
files. - Interactivity: Real-time interactions such as translation, rotation, and toggling between wireframe and filled view.
- Custom Mesh Object Handling: Dedicated
Object
class for managing 3D objects.
- Ensure you have OpenGL and SDL2 installed.
- The GLM library is used for matrix operations and transformations.
To build the project, simply run the build.py
script:
python build.py
This will compile the project into an executable.
- Run the compiled application:
./MeshLoader
- Interactions:
- Arrow Up/Down: Translate the object.
- Arrow Left/Right: Rotate the object.
- W: Toggle between wireframe and filled mode.
This class is responsible for the major operations involving the graphics. Key functions include:
Initialize()
: Set up the necessary OpenGL configurations, load vertices, and shaders.Input()
: Handle keyboard inputs.Draw()
: Render the object.MainLoop()
: The main application loop where input and draw functions are called.
Represents a 3D object. Key features:
- Parses
.obj
files to retrieve vertex and normal data. - Supports different face patterns (
v/vt/vn
,v//vn
, etc.).
- Texture Support: Add support for textured 3D objects.
- Lighting: Implement basic lighting techniques for improved visualization.
- Shader Not Loading: Ensure the path to the shader files is correctly set in the
ShaderLoader
function calls. - Object Not Visible: Ensure the
.obj
file path is correctly specified. Verify the model's scale and position in the 3D space.
Feel free to fork this project and submit pull requests for any enhancements or bug fixes. Ensure you've tested your changes before submitting a pull request.
This project is open source. You can use, modify, and distribute it as per your needs. However, any contributions you make should also be open source.
Thanks to the OpenGL and SDL2 communities for the extensive documentation and tutorials.