Unfolding the matter distribution using three-dimensional weak gravitational lensing