3D Soft engine written in zig
December 10, 2018 ยท View on GitHub
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
- Git Submodules
- zig
- SDL2
- zig-sdl2 brought in as a submode and created by Marc TieHuis.
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