An open API service indexing awesome lists of open source software.

https://github.com/bl33h/3dmodelsflatshading

It is a C++ graphics application that loads and renders 3D models with flat shading using SDL and OpenGL
https://github.com/bl33h/3dmodelsflatshading

3d cmake cpp glm make obj-files sdl2 spaceship tbb wsl

Last synced: 2 months ago
JSON representation

It is a C++ graphics application that loads and renders 3D models with flat shading using SDL and OpenGL

Awesome Lists containing this project

README

        

# 3dModelsFlatShading

The code represents a program for loading and rendering a 3D model using SDL (Simple DirectMedia Layer) and OpenGL.




pic



Files
Features
How To Use

## Files

- **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.

## Features

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.

## How To Use

To clone and run this application, you'll need [WSL (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install) and the following tools installed on it: [Git](https://git-scm.com), [C++ compiler](https://www.fdi.ucm.es/profesor/luis/fp/devtools/mingw.html), [CMake](https://cmake.org/download/), [Make](https://linuxhint.com/install-make-ubuntu/), [glm](https://sourceforge.net/projects/glm.mirror/), [tbb](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onetbb.html), and [SDL2](https://www.oreilly.com/library/view/rust-programming-by/9781788390637/386c15eb-41b2-41b4-bd65-154a750a58d8.xhtml). From your command line:

```bash
# 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