Three-dimensional solution for the diffraction problem of a submerged body in waves