Added 3D support, perspective projection, linear interpolation and a few other routines.