add a function to translate the center of viewer