Skip to content

tomatofoo/obj-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d1fac86 · · May 7, 2026

History

93 Commits
May 3, 2026
May 4, 2026
May 6, 2026
May 7, 2026
May 5, 2026
May 6, 2026
May 5, 2026
May 6, 2026

Repository files navigation

obj-viewer

Stanford Dragon

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.

Features

  • Supports OBJ files with convex faces up to four vertices (most models)
  • Backface culling for performance
  • Flat shading using dot product lighting

Building from Source

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
makeke

The output file is main.out. Move this to the root directory of the repository for it to run properly..

Usage

Drag an OBJ file to the app window. The program will open the file.

Keys

  • 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)

About

An OBJ file viewer that uses software rasterization

Resources

Stars

Watchers

Forks

Packages

No packages published