Heavy ion collisions in three dimensions by the relaxation-time method