Computer Graphics - 3D Scaling Transformation
Last Updated :
02 Jun, 2022
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 : \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}.\\ 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 - \textbf{P'[x, y, z, 1]=P[x, y, z, 1].S[x, y, z]}
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 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 - \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]\\\\ After performing the Scaling Transformation successfully the Fig.1 will look like as below Fig.2 -
Fig.2
Similar Reads
Computer Graphics - 3D Shearing Transformation
Shearing transformation is the same as we see in 2D space, but here we have to deal with the x, y, and z axes whereas in 2D we deal with the only x and y axes. Shearing is the process of slanting an object in 3D space either in x, y, or in the z-direction. Shearing changes(or deformed) the shape of
4 min read
Computer Graphics - 3D Rotation Transformations
Rotation in 3D is more nuanced as compared to the rotation transformation in 2D, as in 3D rotation we have to deal with 3-axes (x, y, z). Rotation about an arbitrary axis There are three kinds of arbitrary rotation, here we can rotate an object just parallel(or along) a specific axis so that the coo
4 min read
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.Re
3 min read
Composite Transformation in 2-D graphics
Prerequisite - Basic types of 2-D Transformation :Â Â TranslationScalingRotationReflectionShearing of a 2-D objectComposite Transformation :Â As the name suggests itself Composition, here we combine two or more transformations into one single transformation that is equivalent to the transformations th
3 min read
Computer Graphics - 3D Translation Transformation
3-D Transformation: In very general terms a 3D model is a mathematical representation of a physical entity that occupies space. In more practical terms, a 3D model is made of a description of its shape and a description of its color appearance.3-D Transformation is the process of manipulating the vi
3 min read
Computer Graphics - 3D Composite Transformation
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: Translation TransformationScal
6 min read
2D Transformation in Computer Graphics | Set 1 (Scaling of Objects)
We can use a 2 Ã 2 matrix to change or transform, a 2D vector. This kind of operation, which takes in a 2-vector and produces another 2-vector by a simple matrix multiplication, is a linear transformation. By this simple formula, we can achieve a variety of useful transformations, depending on what
5 min read
Translation of objects in computer graphics
In computer graphics, we have seen how to draw some basic figures like line and circles. In this post we will discuss on basics of an important operation in computer graphics as well as 2-D geometry, which is transformation. In computer graphics, transformation of the coordinates consists of three m
7 min read
Projections in Computer Graphics
Representing an n-dimensional object into an n-1 dimension is known as projection. It is process of converting a 3D object into 2D object, we represent a 3D object on a 2D plane {(x,y,z)->(x,y)}. It is also defined as mapping or transforming of the object in projection plane or view plane. When g
5 min read
Computer Graphics Rotation
Rotation is one of the part of computer graphic's transformation, Transformation means to change some graphics into something else with the help of rules. There are various types of transformations like translation, scaling, rotation, shearing, reflection etc. it helps to change the object's positio
3 min read