Skip to content
Related Articles

Related Articles

Computer Graphics – Reflection Transformation in 3D
  • Last Updated : 14 Feb, 2021

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:

\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]

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’].

\hspace{4.5cm} \Large P'[x\,\,y\,\,z\,\,1]=P[x\,\,y\,\,z\,\,1].R_{xy}

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:

\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]

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’].

\hspace{4.5cm} \Large P'[x\,\,y\,\,z\,\,1]=P[x\,\,y\,\,z\,\,1].R_{yz}

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:

\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]

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’].

\hspace{4.5cm} \Large P'[x\,\,y\,\,z\,\,1]=P[x\,\,y\,\,z\,\,1].R_{zx}

Consider a cube ‘OABCDEFG’, which is given below, perform reflect transformation over it along Y-Z plane.

The given cube is as follows:




So, Matrix representation condition of Reflection transformation along Y-Z axis: 

\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]

Point O[0 0 0] becomes O’ after performing Reflection transformation:
\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]}

Point A[0 4 0] becomes A’ after performing Reflection transformation:
\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]}

Point B[0 4 4] becomes B’ after performing Reflection transformation:
\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]}

Point C[-4 4 0] becomes C’ after performing Reflection transformation:
\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]}

Point D[4 4 4] becomes D’ after performing Reflection transformation:
\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]}

Point E[4 0 0] becomes E’ after performing Reflection transformation:
\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]}

Point F[0 0 4] becomes F’ after performing Reflection transformation:
\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]}

Point G[4 0 4] becomes G’ after performing Reflection transformation:
\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]}

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.

My Personal Notes arrow_drop_up
Recommended Articles
Page :