The code represents a program for loading and rendering a 3D model using SDL (Simple DirectMedia Layer) and OpenGL.
Files • Features • How To Use
- configure.sh: A shell script to set up the project dependencies and environment.
- build.sh: A shell script to build the project using CMake.
- run.sh: A shell script to execute the compiled graphics application.
- clean.sh: A shell script to clean up build artifacts and generated files.
- src: A directory containing the source code files for the graphics application.
- barycentric.cpp: Implementation of functions related to barycentric coordinates calculation.
- border.cpp: Implementation of functions for drawing lines.
- border.h: Header file declaring functions for drawing lines.
- colors.h: Header file defining color structures and operations.
- fragment.h: Header file defining fragment and shader-related structures.
- framebuffer.cpp: Implementation of functions for handling the frame buffer.
- framebuffer.h: Header file declaring functions and data structures for managing the frame buffer.
- print.h: Header file containing functions for printing various data types.
- shaders.h: Header file defining fragment and vertex shader functions.
- trianglefill.cpp: Implementation of functions for loading 3D models.
- trianglefill.h: Header file declaring functions and data structures for loading 3D models.
- triangles.h: Header file declaring functions and structures related to triangle rendering.
The main features of the graphics application include:
- Loading and rendering 3D models.
- Flat shading of the 3D models.
- Use of barycentric coordinates for triangle rendering.
To clone and run this application, you'll need WSL (Windows Subsystem for Linux) and the following tools installed on it: Git, C++ compiler, CMake, Make, glm, tbb, and SDL2. From your command line:
# Clone this repository
$ git clone https://github.com/bl33h/3dModelsFlatShading
# Open the project
$ cd 3dModelsFlatShading
# Give execution permissions
$ chmod +x configure.sh
$ chmod +x build.sh
$ chmod +x run.sh
# Run the app
$ ./run.sh