Homogeneous Coordinates in 3D Computer Graphics

In computer graphics, objects are represented and manipulated using different mathematical transformations. In a 3D environment, every object consists of a collection of points represented using three coordinates:

P(x,y,z)

where:

  • xx-coordinate represents the position of the point along the X-axis.
  • yy-coordinate represents the position of the point along the Y-axis.
  • zz-coordinate represents the position of the point along the Z-axis.

These coordinates are known as Cartesian Coordinates or Rectangular Coordinates.

For example, a point represented as: P(5,3,4)

means that the point is located 5 units from the origin along the X-axis, 3 units along the Y-axis, and 4 units along the Z-axis.

In three-dimensional computer graphics, objects need to be modified frequently according to the requirements of the application. These modifications are called geometric transformations.

The major 3D transformations are:

  1. Translation
  2. Rotation
  3. Scaling
  4. Reflection
  5. Shearing

These transformations are performed using matrix operations because matrix calculations are faster and easier to implement in computer systems.


Limitations of Cartesian Coordinates in Transformations

Most geometric transformations can be represented using matrix multiplication.

For example, scaling can be represented as:

P'=S×P\[ P' = S \times P \]

where:

  • PP represents the original coordinate.
  • SS represents the transformation matrix.
  • PP' represents the transformed coordinate.

However, translation creates a problem.

The translation operation is represented as:

x'=x+Tx\[ x' = x + T_x \]

y'=y+Ty\[ y' = y + T_y \]

z'=z+Tz\[ z' = z + T_z \]

Here, translation requires addition of values.

A normal 3×3 matrix multiplication cannot perform this addition operation directly.

Therefore, translation cannot be represented using the same matrix form as scaling and rotation.

To overcome this limitation, the concept of homogeneous coordinates is introduced.


Concept of Homogeneous Coordinates

Homogeneous coordinates are an extension of Cartesian coordinates where an additional coordinate is added to represent points.

A 3D point originally represented as: P(x, y, z) is represented using homogeneous coordinates as: P(x, y, z, w)

where:

  • x = coordinate along X-axis
  • y = coordinate along Y-axis
  • z = coordinate along Z-axis
  • w = additional homogeneous coordinate

For normal 3D transformations: w = 1

Therefore, a point: P(x, y, z) is represented as: P(x, y, z, 1)

The addition of the fourth coordinate allows all transformations, including translation, to be represented using a single matrix multiplication operation.


Representation of 3D Homogeneous Coordinates

A point in homogeneous coordinate form is represented as a column matrix:

\[
P =
\begin{bmatrix}
x\\
y\\
z\\
1
\end{bmatrix}
\]

Now all transformations can be represented using a 4×4 transformation matrix.

The general transformation equation becomes: 

\[P' = M \times P\]

where:

  • M is the transformation matrix.
  • P is the original point.
  • P′ is the transformed point.

Homogeneous Coordinates for Translation

Translation Concept

Translation is the process of moving an object from one position to another position in 3D space without changing its shape, size, or orientation.

If a point: P(x, y, z) is translated by: (Tx, Ty, Tz) then the new position becomes:

x'=x+Tx\[x' = x + T_x\]
y'=y+Ty\[y' = y + T_y\]
z'=z+Tz\[z' = z + T_z\]

Using homogeneous coordinates, translation can be represented using a 4×44 \times 44×4 matrix.

The translation matrix is:

\[
T =
\begin{bmatrix}
1 & 0 & 0 & T_x \\
0 & 1 & 0 & T_y \\
0 & 0 & 1 & T_z \\
0 & 0 & 0 & 1
\end{bmatrix}
\]

The transformed coordinate is calculated as: 

\[P' = M \times P\]

Expanded Translation Matrix Multiplication

\[
\begin{bmatrix}
x'\\
y'\\
z'\\
1
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 & 0 & T_x\\
0 & 1 & 0 & T_y\\
0 & 0 & 1 & T_z\\
0 & 0 & 0 & 1
\end{bmatrix}
\begin{bmatrix}
x\\
y\\
z\\
1
\end{bmatrix}
\]

After multiplication:

x'=x+Tx\[x' = x + T_x\]
y'=y+Ty\[y' = y + T_y\]
z'=z+Tz\[z' = z + T_z\]

Thus, homogeneous coordinates successfully represent translation using matrix multiplication.

Previous Post
3D Scaling
Next Post
3D Composite Transformations
0 people found this article helpful

Was this article helpful?