bl33h / 3dModelLoader

A program that uses SDL2 and glm to load, render, and rotate the lines of 3D models from OBJ files for display.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3dModelLoader

The code represents a program for loading and rendering a 3D model using SDL (Simple DirectMedia Layer) and OpenGL. The program is designed to read a 3D model in OBJ format, apply rotation transformations to it, and display the rotated model on the screen.


pic

FilesFeaturesHow 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.
    • colors.h: Header file that defines the Color struct and functions for manipulating colors in the application.
    • triangles.h: Header file that enables drawing triangles using SDL_Renderer with 3D vertices and colors from colors.h.
    • faces.h: Header file that defines the 'Face' struct containing a trio of integer vertex indices.
    • main.cpp: The main C++ source file that implements the graphics application.
  • CMakeLists.txt: The CMake configuration file that manages the build process.

Features

The main features of the graphics application include:

  • 3D Model Loading and Rendering: The program can load 3D models in OBJ format and render them on the screen using SDL and OpenGL.
  • Model Rotation: The application can apply horizontal and vertical rotation transformations to the loaded 3D model, allowing users to visualize the model from different angles.
  • Interactive Display: The program provides an interactive display where users can view the loaded 3D model, rotate it using real-time transformations, and observe the changes in its orientation.
  • Wireframe Rendering: The application renders the 3D model as wireframes, showing the edges and faces of the model using lines.
  • Graphical User Interface: The program features a graphical user interface that utilizes SDL to create a window for rendering the 3D model, enabling easy interaction and visualization.
  • User-Friendly Controls: Users can conveniently control the rotation of the model using the interface, allowing them to explore various viewpoints

How To Use

To clone and run this application, you'll need wsl and the following tools installed on it: Git, C++ compiler, CMake, Make, glm, and SDL2. From your command line:

# Clone this repository
$ git clone https://github.com/bl33h/3dModelLoader

# Open the project
$ cd 3dModelLoader

# Give execution permissions
$ chmod +x configure.sh
$ chmod +x build.sh
$ chmod +x run.sh

# Run the app
$ ./run.sh

About

A program that uses SDL2 and glm to load, render, and rotate the lines of 3D models from OBJ files for display.

License:MIT License


Languages

Language:C++ 96.5%Language:C 3.4%Language:CMake 0.1%Language:Shell 0.0%