Skip to content
Related Articles

Related Articles

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

3-D Transformation is the process of manipulating the view of a three-D object with respect to its original position by modifying its physical attributes through various methods of transformation like Translation, Scaling, Rotation, Shear, etc.

Types of Transformation:

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

Note: If we’re asked to perform three or more different sorts of transformations over a point(P0) simultaneously which is placed in 3D space, and let us assume that these transformations are T1, T2, and T3 respectively, then in this case what we’ll do? 

So, we will see the following solutions

a) Obviously, first by applying series of Transformations one by one over the coordinates of the object sequentially.



First we performed transformation T1, then Po become transformed to P1.

Secondly, we perform transformation T2 and the point P1 become transformed to P2.

Lastly, we perform transformation T3 and we get the final result i.e; P3,and we will get our final transformed point coordinate(P3).

b) Second solution, by applying Composite transformation in a single shot.

\mathbf{P_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=P_0[x_0\hspace{0.2cm}y_0\hspace{0.2cm}z_0\hspace{0.2cm}1].T_1} \newline \hspace{5.87cm}\mathbf{P_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[x_1\hspace{0.2cm}y_1\hspace{0.2cm}z_1]} \\ \hspace{4.37cm}\mathbf{P_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=P_1[x_1\hspace{0.2cm}y_1\hspace{0.2cm}z_1\hspace{0.2cm}1].T_2} \newline \hspace{5.87cm}\mathbf{P_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[x_2\hspace{0.2cm}y_2\hspace{0.2cm}z_2]} \newline \hspace{4.37cm}\mathbf{P_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=P_2[x_2\hspace{0.2cm}y_2\hspace{0.2cm}z_2\hspace{0.2cm}1].T_3} \newline \hspace{5.87cm}\mathbf{P_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[x_3\hspace{0.2cm}y_3\hspace{0.2cm}z_3]}\\ \textbf {But the idea that is concerned in Composite Transformation is} \newline \textbf{slightly different, that we'll discuss in detail in the following article.}

Note: Here T1, T2, T3 correspond to their transformation matrix condition.

Composite Transformation

As its name suggests itself composite, here we compose two or more than two transformations together and calculate a resultant(R) transformation matrix by multiplying all the corresponding transformation matrix conditions with each other. 

The same equivalent result that we got over Point P0 and transformed it into P3 in the above example can also be achieved by directly multiplying resultant R with the point P0 rather than performing transformations T1, T2, and T3 sequentially one after one.



\mathbf{R=[T_1*T_2*T_3]} \newline \hspace{4.37cm}\mathbf{P_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=P_0[x_0\hspace{0.2cm}y_0\hspace{0.2cm}z_0\hspace{0.2cm}1].R} \\ \hspace{5.87cm}\mathbf{P_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[x_3\hspace{0.2cm}y_3\hspace{0.2cm}z_3]}
 

And we end up with the same equivalent result that we got into our above example.

Problem: Consider we are given with a cuboid “OABCDEFG” over which we want to perform 

  • Translation transformation(T1) if translation distances are Dx=2, Dy=3, Dz=2 ,then 
  • Scaling transformation(T2) if scaling factors are sx=2, sy=1, sz=3 and lastly perform,
  • Shearing transformation(T3) in x-direction if shearing factors are sy=2 and sz=1.

Solution: We are given the following cuboid

 

Fig.1

First, we perform translation transformation T1:

The Translation transformation matrix is shown as:

\mathbf{T_1=\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\D_x&D_y&D_z&1\end{matrix}\right]}\\ \mathbf{Where \hspace{0.2cm}D_x=2,D_y=3\hspace{0.2cm} and\hspace{0.2cm} D_z=3\hspace{0.2cm} are\hspace{0.2cm}translaton\hspace{0.2cm} distances.}    [Tex]\hspace{4.37cm}\mathbf{T_1=\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\D_x&D_y&D_z&1\end{matrix}\right]}\\ \mathbf{Where \hspace{0.2cm}D_x=2,D_y=3\hspace{0.2cm} and\hspace{0.2cm} D_z=3\hspace{0.2cm} are\hspace{0.2cm}translaton\hspace{0.2cm} distances.} [/Tex]

Now apply this translation transformation matrix condition over the coordinates:

For coordinate O[0 0 0], the newly translated coordinate would be O1:

\mathbf{O_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=O[0\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[2\hspace{0.2cm}3\hspace{0.2cm}2\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{O_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[2\hspace{0.2cm}3\hspace{0.2cm}2]}

For coordinate A[0 0 4], the newly translated coordinate would be A1:

\mathbf{A_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=A[0\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[2\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{A_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[2\hspace{0.2cm}3\hspace{0.2cm}6]}

For coordinate B[0 4 2], the newly translated coordinate would be B1:

\mathbf{B_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=B[0\hspace{0.2cm}4\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[2\hspace{0.2cm}7\hspace{0.2cm}4\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{B_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[2\hspace{0.2cm}7\hspace{0.2cm}4]}

For coordinate C[2 4 0], the newly translated coordinate would be C1:

\mathbf{C_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=C[2\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[4\hspace{0.2cm}7\hspace{0.2cm}2\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{C_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}7\hspace{0.2cm}2]}

For coordinate D[2 2 4], the newly translated coordinate would be D1:

\mathbf{D_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=D[2\hspace{0.2cm}2\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}5\hspace{0.2cm}6\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{D_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}5\hspace{0.2cm}6]}

For coordinate E[2 0 0], the newly translated coordinate would be E1:

\mathbf{E_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=E[2\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}3\hspace{0.2cm}2\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{E_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}3\hspace{0.2cm}2]}

For coordinate F[0 0 2], the newly translated coordinate would be F1:

\mathbf{F_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=F[0\hspace{0.2cm}0\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[2\hspace{0.2cm}3\hspace{0.2cm}4\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{F_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[2\hspace{0.2cm}3\hspace{0.2cm}4]}

For coordinate G[2  0  2], the newly translated coordinate would be G1:

\mathbf{G_1[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=G[2\hspace{0.2cm}0\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}3\hspace{0.2cm}4\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{G_1[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}3\hspace{0.2cm}4]}

Fig.2

Secondly, we are said to perform Scaling transformation T2:

The Scaling transformation matrix is shown as:

\hspace{4.37cm}\mathbf{T_2=\left[\begin{matrix}s_x&0&0&0\\0&s_y&0&0\\0&0&s_z&0\\D_x&D_y&D_z&1\end{matrix}\right]}\\ \mathbf{Where \hspace{0.2cm}s_x=2,s_y=1\hspace{0.2cm} and\hspace{0.2cm} s_z=3\hspace{0.2cm} are\hspace{0.2cm}Scaling\hspace{0.2cm}parameter.}

Now apply this Scaling transformation matrix condition over the coordinates:

For coordinate O1[2 3 2], the newly Scaled coordinate would be O2:

\mathbf{O_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=O_1[2\hspace{0.2cm}3\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{O_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}3\hspace{0.2cm}6]}

For coordinate A1[2 3 6], the newly Scaled coordinate would be A2:

\mathbf{A_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=A_1[2\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}3\hspace{0.2cm}18\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{A_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}3\hspace{0.2cm}18]}

For coordinate B1[2 7 4], the newly Scaled coordinate would be B2:

\mathbf{B_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=B_1[2\hspace{0.2cm}7\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}7\hspace{0.2cm}12\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{B_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}7\hspace{0.2cm}12]}

For coordinate C1[4 7 2], the newly Scaled coordinate would be C2:

\mathbf{C_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=C_1[2\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}7\hspace{0.2cm}6\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{C_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}7\hspace{0.2cm}6]}

For coordinate D1[4 5 6], the newly Scaled coordinate would be D2:

\mathbf{D_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=D_1[4\hspace{0.2cm}5\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}5\hspace{0.2cm}18\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{D_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}5\hspace{0.2cm}18]}

For coordinate E1[4 3 2], the newly Scaled coordinate would be E2:

\mathbf{E_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=E_1[4\hspace{0.2cm}3\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{E_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}3\hspace{0.2cm}6]}

For coordinate F1[2 3 4], the newly Scaled coordinate would be F2:

\mathbf{F_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=F_1[2\hspace{0.2cm}3\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}3\hspace{0.2cm}12\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{F_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}3\hspace{0.2cm}12]}

For coordinate G1[4 3 4], the newly Scaled coordinate would be G2:

\mathbf{G_2[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=G_1[4\hspace{0.2cm}3\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}3\hspace{0.2cm}12\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{G_2[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}3\hspace{0.2cm}12]}

Fig.3

 

Lastly, we perform Shearing transformation T3 in x-direction:

The Shearing transformation matrix for x-direction is shown as:

\hspace{4.37cm}\mathbf{T_3=\left[\begin{matrix}1&sh_y&sh_z&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \mathbf{Where \hspace{0.2cm}sh_y=2\hspace{0.2cm}and\hspace{0.2cm}sh_z=1\hspace{0.2cm}are\hspace{0.2cm}Shearing\hspace{0.2cm}parameter.}

Now, apply this Shearing transformation matrix condition over the coordinates:

For coordinate O2[4 3 6], the newly Scaled coordinate would be O3:

\mathbf{O_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=O_2[4\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}10\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{O_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}10]}

For coordinate A2[4  3 18], the newly Scaled coordinate would be A3:

\mathbf{A_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=A_2[4\hspace{0.2cm}3\hspace{0.2cm}18\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}22\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{A_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}22]}

For coordinate B2[4  7 12], the newly Scaled coordinate would be B3:

\mathbf{B_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=B_2[4\hspace{0.2cm}7\hspace{0.2cm}12\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}15\hspace{0.2cm}16\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{B_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}15\hspace{0.2cm}16]}

For coordinate C2[8  7  6], the newly Scaled coordinate would be C3:

\mathbf{C_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=C_2[8\hspace{0.2cm}7\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}23\hspace{0.2cm}14\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{C_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}23\hspace{0.2cm}14]}

For coordinate D2[8   5  18], the newly Scaled coordinate would be D3:

\mathbf{D_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=D_2[8\hspace{0.2cm}6\hspace{0.2cm}18\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}21\hspace{0.2cm}26\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{D_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}21\hspace{0.2cm}26]}

For coordinate E2[8  7  6], the newly Scaled coordinate would be E3:

\mathbf{E_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=E_2[8\hspace{0.2cm}3\hspace{0.2cm}6\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[8\hspace{0.2cm}19\hspace{0.2cm}14\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{E_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}19\hspace{0.2cm}14]}

For coordinate F2[4  3  12], the newly Scaled coordinate would be F3:

\mathbf{F_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=F_2[4\hspace{0.2cm}3\hspace{0.2cm}12\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}16\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{F_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}16]}

For coordinate G2[8  3 12], the newly Scaled coordinate would be G3:

\mathbf{G_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=G_2[8\hspace{0.2cm}3\hspace{0.2cm}12\hspace{0.2cm}1]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}19\hspace{0.2cm}20\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{G_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}19\hspace{0.2cm}20]}

Finally, we get our resized slanted object in the x-direction after performing transformations T1, T2 and T3.

Fig.4

Solution through Composite Transformation

The final result, that we got above for the cuboid “OABCDEF” through applying transformation T1, T2, and T3  one after one in sequential order the same equivalent result could also be got by using the concept of Composite Transformation. To perform composite transformation first we need to calculate the Resultant Transformation matrix(R) by combining all the distinguished transformation matrix representations together.

The resultant transformation matrix would be calculated as follows: 

The resultant transformation will be calculated by multiplying the Translation transformation matrix with the Scaling transformation matrix and the resultant(R2) multiplication of both will then be multiplied with the last given, Shearing transformation matrix.

\hspace{4.37cm}\mathbf{R_2=\left[\begin{matrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\2&3&2&1\end{matrix}\right]*\mathbf{\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\0&0&0&1\end{matrix}\right]}} \\ \newline\hspace{4.37cm}\mathbf{R_2=\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\4&3&6&1\end{matrix}\right]}\\
 

Now, multiply R2 with the Shearing transformation matrix to get resultant R:

\mathbf{R=R_2*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\\hspace{2.87cm}\mathbf{R=\left[\begin{matrix}2&0&0&0\\0&1&0&0\\0&0&3&0\\4&3&6&1\end{matrix}\right]*\left[\begin{matrix}1&2&1&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{matrix}\right]}\\ \newline \hspace{4.15cm} \mathbf{R=\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}   \

Now, apply this resultant transformation matrix condition over the coordinates:

For coordinate O[0 0 0], the new Scaled coordinate would be O3:

\mathbf{O_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=O[0\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}10\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{O_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}10]}

For coordinate A[0 0 4], the newly Scaled coordinate would be A3:

\mathbf{A_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=A[0\hspace{0.2cm}0\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}22\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{A_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}22]}

For coordinate B[0 4 2], the newly Scaled coordinate would be B3:

\mathbf{B_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=B[0\hspace{0.2cm}4\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \hspace{6.52cm}\mathbf{=[4\hspace{0.2cm}15\hspace{0.2cm}16\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{B_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}15\hspace{0.2cm}16]}

For coordinate C[2 4 0], the newly Scaled coordinate would be C3:

\mathbf{C_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=C[2\hspace{0.2cm}4\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}23\hspace{0.2cm}14\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{C_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}23\hspace{0.2cm}14]}

For coordinate D[2  2  4], the newly Scaled coordinate would be D3:

\mathbf{D_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=D[2\hspace{0.2cm}2\hspace{0.2cm}4\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}21\hspace{0.2cm}26\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{D_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}21\hspace{0.2cm}26]}

For coordinate E[2  0  0], the newly Scaled coordinate would be E3:

\mathbf{E_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=E[2\hspace{0.2cm}0\hspace{0.2cm}0\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\\hspace{6.52cm} \mathbf{=[8\hspace{0.2cm}19\hspace{0.2cm}14\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{E_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}19\hspace{0.2cm}14]}

For coordinate F[0  0  2], the newly Scaled coordinate would be F3:

\mathbf{F_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=F[0\hspace{0.2cm}0\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[4\hspace{0.2cm}11\hspace{0.2cm}16\hspace{0.2cm}1]} \\\hspace{4.15cm} \mathbf{F_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[4\hspace{0.2cm}11\hspace{0.2cm}16]}

For coordinate G[2  0  2], the newly Scaled coordinate would be G3:

\mathbf{G_3[x\hspace{0.2cm}y\hspace{0.2cm}z\hspace{0.2cm}1]=G[2\hspace{0.2cm}0\hspace{0.2cm}2\hspace{0.2cm}1]*\left[\begin{matrix}2&4&2&0\\0&1&0&0\\0&0&3&0\\4&11&10&1\end{matrix}\right]}\\ \\ \hspace{6.52cm}\mathbf{=[8\hspace{0.2cm}19\hspace{0.2cm}20\hspace{0.2cm}1]} \\ \hspace{4.15cm}\mathbf{G_3[x\hspace{0.2cm}y\hspace{0.2cm}z]=[8\hspace{0.2cm}19\hspace{0.2cm}20]}

Here, we get our final result in a single shot:

Fig.5

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 :