Global rotation of mechanical metamaterials induced by their internal deformation