Categories
Graphics Library
  • Github CLI
  • SSH
  • HTTPS
Clone Repo

3D Soft engine written in zig

This is a first attempt by a person with no experience in creating a 3D engine. So take everything you see with a huge grain of salt. But if you have suggestions feel free to raise an issue, provide a PR or contact me.

The engine is based on David Rousset’s tutorial. Plus math3d from Andrew Kelly’s Tetris with additions based on SharpDx.

Also the backend for creating Windows and displaying bitmaps uses Marc Tiehuis’s sdl2 and the scribling code is based on Daniel D’Agostino SDL2 Pixel Drawing tutorial and the code is here.

Dependencies

Needs zig PR 1820: https://github.com/ziglang/zig/pull/1820 so fn saturateCast in zig-misc works

Checkout

git clone --recurse-submodules https://github.com/winksaville/zig-3d-soft-engine

Build

zig build

Test individual components

zig test --test-filter "camera" src/camera.zig
zig test --test-filter "mesh" src/mesh.zig
zig test --test-filter "inputEvents" src/input_events.zig
zig test --test-filter "math3d" src/math3d.zig
zig test --test-filter "window" --library c --library SDL2 src/window.zig

Run

./3d-soft-engine
About
An attempt to create a 3D engine in software using zig.
Owner
Last Commit
2019-03-05
Latest Release
Latest Release Date
Created
2018-10-13