Rendering 3d scene using pure math