Every affine variety $V$ has a unique projective closure $\overline{V}$, and there is an injective morphism $\iota : V \rightarrow \overline{V}$ given by something like $\iota(X_1,\ldots, X_n) = (X_1, \ldots, X_n, 1)$. The projective variety $\overline{V}$ can be determined explicitly by homogenizing the polynomials which define $V$.
Now suppose $f: V_1 \rightarrow V_2$ is a morphism of affine varieties. My intuition says that there is a way to "complete" $f$ to give a morphism of projective varieties $\overline{f} : \overline{V_1} \rightarrow \overline{V_2}$ in a way that agrees with $f$ on the affine subvariety $V_1$. In other words, I think there should be some projective morphism $\overline{f}$ that yields a commutative diagram $\iota_2 \circ f = \overline{f} \circ \iota_1$. Since the value of $\overline{f}$ is determined by $f$ on $V_1$, it remains only to define $\overline{f}$ on the points at infinity on $V_1$.
My questions is does such an $\overline{f}$ always exist, is it unique, and how can it be determined?