Helper method for convert orientation to affine transform.