Added 3D calibration function.