Mean-field model for the interference of matter–waves from a three-dimensional optical trap