Shading and rasterizing 3D models manually (i.e. without OpenGL)