The effects of environment on the intrinsic shape of galaxies