A software 3D model renderer of 2k lines of code, features include:
- Reading in OBJ model
- Ray tracing
- Phong shading
- Bump mapping
All features are implemented from scratch, xlib
is the only dependent library. xlib
is used only for drawing pixels.
make
(you might need to install libx11-dev
before this step)
./render model/teapot.obj 800x600 # 800x600 is the resolution, can be omitted
use `wsad` and `q` `e` to rotate about 3 axes
use ARROW keys to move
use `+` `-` to scale
use `r` to toggle ray tracing
use `p` to toggle phong soomthing
use `b` to toggle bump mapping
use 'z' to toggle between wireframe/z-buffer mode
use 'v' to toggle between orthogonal/perspective view