General methods for three-dimensional culture