Computer Graphics – 3D Scaling Transformation
Prerequisite: Computer Graphics – 3D Translation Transformation
Scaling Transformation :
It is performed to resize the 3D-object that is the dimension of the object can be scaled(alter) in any of the x, y, z direction through Sx, Sy, Sz scaling factors.
Matrix representation of Scaling transformation Condition :
![Rendered by QuickLaTeX.com \large S[x, y, z]= \left [ \begin{matrix} S_x &0&0& 0\\ 0 & S_y&0&0&\\ 0 & 0&S_z&0\\ 0&0&0&1\\ \end{matrix}\right]\\ where\, S_x, \, S_y, \, S_z\, \text{are}\, \text{the}\, \text{Scaling\, Factors}.\\](https://web.archive.org/web/20220117051448im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-0f61486fe5d97638b10ce6b89825a56f_l3.png)
The following kind of sequences occur while performing the scaling transformations on a fixed point –
- The fixed point is translated to the origin.
- The object is scaled.
- The fixed point is translated to its original position.
Let a point in 3D space is P(x, y, z) over which we want to apply Scaling Transformation operation and we are given with Scaling factor [Sx, Sy, Sz] So, the new position of the point after applying Scaling operation would be –
![]()
Note : If Scaling factor (Sx, Sy, Sz), then, in this case, the 3D object will be Scaled up uniformly in all X, Y, Z direction.
Problem :
Consider the above problem where a cube” OABCDEFG” is given O(0, 0, 0, ), A(0, 4, 0), B(0, 4, 4), C(4, 4, 0), D(4, 4, 4), E(4, 0, 0), F(0, 0, 4), G (4, 0, 4) and we are given with Scaling factor Sx, Sy, Sz. Perform Scaling operation operation over the cube.
Solution :
We are asked to perform the Scaling transformation over the given below 3D object Fig.1:

Fig.1
Now, applying the Matrix Scaling transformation condition we get –
![Rendered by QuickLaTeX.com \large O'[x, y, z, 1]= [0\, 0\, 0\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[0\, 0\, 0\, 1]\\\\ \hspace{4cm}A'[x, y, z, 1]= [0\, 4\, 0\, 1]\left [\begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[0\, 12\, 0\, 1]\\\\ \hspace{4cm}B'[x, y, z, 1]= [0\, 4\, 4\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[0\, 12\, 8\, 1]\\\\ \hspace{4cm}C'[x, y, z, 1]= [4\, 4\, 0\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[8\, 12\, 0\, 1]\\\\ \hspace{4cm}D'[x, y, z, 1]= [4\, 4\, 4\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[8\, 12\, 8\, 1]\\\\ \hspace{4cm}E'[x, y, z, 1]= [4\, 0\, 0\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[8\, 0\, 0\, 1]\\\\ \hspace{4cm}F'[x, y, z, 1]= [0\, 0\, 4\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[0\, 0\, 8\, 1]\\\\ \hspace{4cm}G'[x, y, z, 1]= [4\, 0\, 4\, 1]\left [ \begin{matrix} 2&0&0&0\\ 0&3&0&0\\ 0&0&2&0\\ 0&0&0&1\\ \end{matrix}\right]=[8\, 0\, 8\, 1]\\\\](https://web.archive.org/web/20220117051448im_/https://www.geeksforgeeks.org/wp-content/ql-cache/quicklatex.com-e1a65583ba33aeb6cc77141c08a927aa_l3.png)
After performing the Scaling Transformation successfully the Fig.1 will look like as below Fig.2 –

Fig.2


