The O(3) gauge transformation and 3-state vertex models