Interacting boson model of collective nuclear states III. The transition from SU(5) to SU(3)