3D Modeling - Using Homogeneous Coordinates

Using Homogeneous Coordinates

In projective geometry, often used in computer graphics, points are represented using homogeneous coordinates. To scale an object by a vector v = (vx, vy, vz), each homogeneous coordinate vector p = (px, py, pz, 1) would need to be multiplied with this projective transformation matrix:

 S_v =
\begin{bmatrix}
v_x & 0 & 0 & 0 \\
0 & v_y & 0 & 0 \\
0 & 0 & v_z & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}.

As shown below, the multiplication will give the expected result:


S_vp =
\begin{bmatrix}
v_x & 0 & 0 & 0 \\
0 & v_y & 0 & 0 \\
0 & 0 & v_z & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ 1
\end{bmatrix}
=
\begin{bmatrix}
v_xp_x \\ v_yp_y \\ v_zp_z \\ 1
\end{bmatrix}.

Since the last component of a homogeneous coordinate can be viewed as the denominator of the other three components, a uniform scaling by a common factor s (uniform scaling) can be accomplished by using this scaling matrix:

 S_v =
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & \frac{1}{s}
\end{bmatrix}.

For each vector p = (px, py, pz, 1) we would have


S_vp =
\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & \frac{1}{s}
\end{bmatrix}
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ 1
\end{bmatrix}
=
\begin{bmatrix}
p_x \\ p_y \\ p_z \\ \frac{1}{s}
\end{bmatrix}

which would be homogenized to


\begin{bmatrix}
sp_x \\ sp_y \\ sp_z \\ 1
\end{bmatrix}.

Read more about this topic:  3D Modeling

Famous quotes containing the word homogeneous:

    If we Americans are to survive it will have to be because we choose and elect and defend to be first of all Americans; to present to the world one homogeneous and unbroken front, whether of white Americans or black ones or purple or blue or green.... If we in America have reached that point in our desperate culture when we must murder children, no matter for what reason or what color, we don’t deserve to survive, and probably won’t.
    William Faulkner (1897–1962)