What is 3D transformation?

3D transformation in homogeneous coordinates manipulates the position, orientation, and scale of 3D objects in three-dimensional space.

Homogeneous coordinates

Homogeneous coordinates extend the traditional Cartesian coordinates (X, Y, Z) with an additional coordinate (X, Y, Z, W), enabling the perspective projections using matrix multiplication.

The homogeneous coordinates (X, Y, Z, W) represents a 3D point as follows:

3D transformations using homogeneous coordinates are typically represented as 4×44\times4 matrices, known as transformation matrices.

Translation

The translation moves an object in 3D space along the x, y, and z axes. Suppose (x,y,z,1)(x,y,z,1) is a point in 3D space and (x,y,z,1)(x',y',z',1) is a transformed point, then the translation equation would be:

Here, d (tx,ty,tz,1)(t_{x},t_{y},t_{z},1)represents the translation vector. The following figure visualizes the 3D translation:

Blue box have been translated to the 0.5 points on x, y, and z axis.
Blue box have been translated to the 0.5 points on x, y, and z axis.

Rotation

Rotation involves changing the orientation of an object around one or more axes. The rotation occurs along an axis. It also includes the angle of rotation θ\theta that determines the extent to which the object will be turned about that axis. If θ\theta is positive, the rotation would be counterclockwise.

Suppose (x,y,z,1)(x,y,z,1) is a point in 3D space and (x,y,z,1)(x',y',z',1) is a transformed point, then the rotation along the x-axis would be:

The rotation along the y-axis would be:

The rotation along the z-axis would be:

Here, θ\theta represents the angle of rotation. The following figure visualizes the 3D rotation:

Blue box has been rotated 30° about x-axis, 45° about y-axis and 60° about z-axis.
Blue box has been rotated 30° about x-axis, 45° about y-axis and 60° about z-axis.

Scale

Scaling is the process of resizing an object in 3D space. Suppose (x,y,z,1)(x,y,z,1) is a point in 3D space and (x,y,z,1)(x',y',z',1) is a transformed point, then the scaling equation would be:

where, Sx,Sy,and SzS_{x}, S_{y} , \textnormal{and }S_{z} represent the scaling factors along the x,y, and zx, y \textnormal{, and }z axes, respectively. The following figure visualizes the 3D scaling:

Blue cube has been scaled to 1.5 along x-axis, 0.8 along y-axis, and 1.2 along z-axis.
Blue cube has been scaled to 1.5 along x-axis, 0.8 along y-axis, and 1.2 along z-axis.

Shear

The shear transformation distorts the shape of an object along one or more axes. Suppose (x,y,z,1)(x,y,z,1) is a point in 3D space and (x,y,z,1)(x',y',z',1) is a transformed point, then the shearing equation would be:

where sx,sy,and szs_{x}, s_{y} , \textnormal{and }s_{z} are the shear factors along the x, y, and z axes, respectively. The following figure visualizes the 3D shearing:

Blue cube has been sheared with a factor of 0.2 along the x-axis, 0.3 along the y-axis, and 0.1 along the z-axis.
Blue cube has been sheared with a factor of 0.2 along the x-axis, 0.3 along the y-axis, and 0.1 along the z-axis.

Conclusion

By understanding and using 3D transformations effectively, we can create complex and realistic 3D scenes in computer graphics. It plays a crucial role in various applications, from video games and animation to medical imaging and augmented reality.

Note: Learn about two dimentional transformation.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved