Added some primitive 3D stuff. Still needs to be debugged.