An OBJ file viewer that uses software rasterization. Texture support is planned, but not yet implemented. This was my first time making an actual project in C, and I tried to make the code good. This includes error checking (SO MUCH ERROR CHECKING), thread safety, and decent memory management.nt.
- Supports OBJ files with convex faces up to four vertices (most models)
- Backface culling for performance
- Flat shading using dot product lighting
To build this project from source, install SDL3, SDL3_image, and
SDL3_ttf, and run these commands in your favorite terminal emulator:
git clone https://github.com/tomatofoo/obj-viewer
cd obj-viewer
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
makekeThe output file is main.out. Move this to the root directory of the
repository for it to run properly..
Drag an OBJ file to the app window. The program will open the file.
- W: Move forward
- A: Strafe left
- S: Move backward
- D: Strafe right
- Space: Move up
- Left Shift: Move down
- Left: Look left
- Right: Look right
- Up: Look up
- Down: Look down
- F2: Take a screenshot (supports PNG and JPEG, default PNG)