A simple 3D object viewer implemented in C++ using SDL2. This project was created as a learning exercise to understand 3D graphics programming concepts like perspective projection, quaternion rotation, and basic rendering pipelines.
This project implements a basic 3D object viewer with the following features:
- Basic perspective projection
- Quaternion-based camera rotation
- Wireframe rendering
- Basic object loading
- Simple player/camera movement
Note: This is a learning project and not meant for production use. It lacks many features of a proper 3D viewer (like proper culling, efficient rendering, texture support, etc.) but serves as a practical way to understand 3D graphics fundamentals.
- SDL2
- tiny obj loader Github Repo
- C++11 or higher
- Make
brew install sdl2- Clone the repository:
git clone https://github.com/AlexanderDotEXE/SimpleObjViewer.git
cd SimpleObjViewer- Create build directory:
mkdir build- Build the project:
makeAfter building, run the executable from the project root:
./build/main- WASD: Move camera
- Arrow keys: Look around
If you're interested in learning more about 3D graphics programming, here are some topics this project explores:
- Perspective projection
- Quaternion rotations
- Vector mathematics
- Basic rendering pipeline
- Camera transformations
MIT License: Use my Software however you want, just give credit where credit is due!
This project uses quaternion rotation code adapted from imadr.me/rotations-with-quaternions/
