Making rotations based on quaternions