3D version of pressure calculation. (completely the same as 2D version)