Computer Graphics – Reflection Transformation in 3D
Reflection in 3D space is quite similar to the reflection in 2D space, but a single difference is there in 3D, here we have to deal with three axes (x, y, z). Reflection is nothing but a mirror image of an object.
Three kinds of Reflections are possible in 3D space:
- Reflection along the X-Y plane.
- Reflection along Y-Z plane.
- Reflection along X-Z plane.
1. Reflection along the X-Y plane: This is shown in the following figure –

Reflection along x-y plane
The Reflection transformation matrix is used to perform the reflection operation over the 3D image, which is as follows:
![Rendered by QuickLaTeX.com \hspace{4.5cm} \Large R_{xy} =\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-6b97138a7de1694a0add86ee5d2f4714_l3.png)
Consider, a point P[x, y, z] which is in 3D space is made to reflect along X-Y direction after reflection P[x, y, z] becomes P'[x’ ,y’ ,z’].
![]()
2. Reflection along the Y-Z plane: This is shown in the following figure –

Reflection along the Y-Z plane
The reflection transformation matrix for y-z axes is as follows:
![Rendered by QuickLaTeX.com \hspace{4.5cm} \Large R_{yz} =\left[\begin{matrix}-1&0&0&0\\ 0&1&0&0\\ 0&0&1&0\\0&0&0&1\end{matrix}\right]](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-dc638e403f10d6984d083ae87bd24851_l3.png)
Consider, a point P[x, y, z] which is in 3D space is made to reflect along Y-Z direction, after reflection P[x, y, z] becomes P'[x’ ,y’ ,z’].
![]()
3. Reflection along the X-Z plane: This is shown in the following figure –

Reflection along the X-Z plane:
The Reflection transformation matrix for z-x axes is as follows:
![Rendered by QuickLaTeX.com \hspace{4.5cm} \Large R_{zx} =\left[\begin{matrix}1&0&0&0\\ 0&-1&0&0\\ 0&0&1&0\\0&0&0&1\end{matrix}\right]](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-d093fc81b2b5eebf213e8558656688ba_l3.png)
Consider, a point P[x, y, z] which is in 3D space is made to reflect along Z-X direction, after reflection P[x, y, z] becomes P'[x’, y’, z’].
![]()
Consider a cube ‘OABCDEFG’, which is given below, perform reflect transformation over it along Y-Z plane.
The given cube is as follows:

Fig.1
So, Matrix representation condition of Reflection transformation along Y-Z axis:
![Rendered by QuickLaTeX.com \hspace{4.5cm} \Large R_{yz} =\left[\begin{matrix}-1&0&0&0\\ 0&1&0&0\\ 0&0&1&0\\0&0&0&1\end{matrix}\right]](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-dc638e403f10d6984d083ae87bd24851_l3.png)
Point O[0 0 0] becomes O’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large O'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[0\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]} \\ \hspace{6.68cm}\Large \mathbf{=[0\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]}\\ \hspace{4.37cm}\mathbf{O'[x ,y ,z]=[0 ,0 ,0]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-6de3b68bcb55a2e3506534a8aa5dc4d8_l3.png)
Point A[0 4 0] becomes A’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large A'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[0\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm}\Large\mathbf{=[0\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}1]}\\ \hspace{4.37cm}\Large\mathbf{A'[x ,y ,z]=[0 ,4 ,0]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-695d93d9d19b120722cca4492315a45c_l3.png)
Point B[0 4 4] becomes B’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large B'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[0\hspace{0.2cm}4\hspace{0.2cm}4\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm}\Large\mathbf{=[0\hspace{0.2cm}4\hspace{0.2cm}4\hspace{0.2cm}1]} \newline \hspace{4.37cm}\Large\mathbf{B'[x ,y ,z]=[0 ,4 ,4]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-4808c5c6d7511849e5d20bd21c101962_l3.png)
Point C[-4 4 0] becomes C’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large C'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[4\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm} \Large \mathbf{=[-4\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}1]}\\ \newline \hspace{4.37cm}\Large\mathbf{C'[x ,y ,z]=[-4 ,4 ,0]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-d63f09577512a5aad1ef4f7f87067892_l3.png)
Point D[4 4 4] becomes D’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large D'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[4\hspace{0.2cm}4\hspace{0.2cm}4\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm}\Large \mathbf{=[-4\hspace{0.2cm}4\hspace{0.2cm}4\hspace{0.2cm}1]}\\ \hspace{4.37cm}\Large\mathbf{D'[x ,y ,z]=[-4 ,4 ,4]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-c8866dd6cba6546425d60190c9503ee6_l3.png)
Point E[4 0 0] becomes E’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large E'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[4\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm} \Large\mathbf{=[-4\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]}\\ \hspace{4.37cm}\mathbf{E'[x ,y ,z]=[-4 ,0 ,0]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-bf8488924329b01faf29fe87c756b968_l3.png)
Point F[0 0 4] becomes F’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large F'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[0\hspace{0.2cm}0\hspace{0.2cm}4\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm}\Large \mathbf{=[0\hspace{0.2cm}0\hspace{0.2cm}4\hspace{0.2cm}1]}\\ \hspace{4.37cm}\mathbf{F'[x ,y ,z]=[0 ,0 ,4]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-d07ba71f5845ffdfcf824e083c6a8c14_l3.png)
Point G[4 0 4] becomes G’ after performing Reflection transformation:![Rendered by QuickLaTeX.com \hspace{4cm} \mathbf{\Large G'[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=[4\hspace{0.2cm}0\hspace{0.2cm}4\hspace{0.2cm}\hspace{0.2cm}1]\left[\begin{matrix}1&0&0&0\\ 0&1&0&0\\ 0&0&-1&0\\0&0&0&1\end{matrix}\right]}\\ \hspace{6.68cm}\Large \mathbf{=[-4\hspace{0.2cm}0\hspace{0.2cm}4\hspace{0.2cm}1]}\\ \newline \hspace{4.37cm}\mathbf{G'[x ,y ,z]=[-4 ,0 ,4]}](https://web.archive.org/web/20211023113150im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-e815a36d1ec8a5adc29ab2ba132d6e8e_l3.png)
After performing Reflection Transformation over the above figure (Fig.1) would look like:

Reflected 3D image
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.



