Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore CU-BCA-SEM-IV-Computer Graphics_Second Draft

CU-BCA-SEM-IV-Computer Graphics_Second Draft

Published by Teamlease Edtech Ltd (Amita Chitroda), 2021-09-09 06:19:38

Description: CU-BCA-SEM-IV-Computer Graphics_Second Draft

Search

Read the Text Version

Composite transformation can be achieved by concatenation of transformation matrices to obtain a combined transformation matrix. A Combined Matrix [T][X] = [X] [T1] [T2] [T3] [T4] …. [Tn] Where [Ti] is any combination of i. Translation ii. Scaling iii. Shearing iv. Rotation Reflection The change in the order of transformation would lead to different results, as in general matrix multiplication is not cumulative, that is [A] . [B] ≠ [B] . [A] and the order of multiplication. The basic purpose of composing transformations is to gain efficiency by applying a single composed transformation to a point, rather than applying a series of transformation, one after another. In rotation transformation, an object is repositioned along a circular path in the xy plane. The rotation is performed with certain angle θ, known as rotation angle. Rotation can be performed in two ways: about origin or about an arbitrary point called as rotation point or pivot point. 9.2 ROTATION Rotation about origin The pivot point here is the origin. We can obtain transformation equations for rotating a point (x, y) through an angleθ to obtain final point as (x’, y) with the help of figure 9.1 as x' = x cosθ – y sinθ y' = x sinθ + y cosθ 151 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 9.1: Rotation about origin The transformation matrix for rotation can be written as Hence, the rotation transformation in matrix form can be represented as (x1, y1) P' = R.P Rotation about an Arbitrary Origin It is often required in many applications to rotate an object about an arbitrary point rather than the origin. Rotation about an arbitrary pivot point (xr, yr) is shown in the figure 9.2. 152 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 9.2: Rotation about an arbitrary origin The corresponding equation obtained will be x' = xt + (x – xt) cosθ– (y – yt) sinθ y' = yt + (x – xt) sinθ + (y – yt) cosθ We can see the difference between this rotation transformation from the previous one .This one contains theadditive terms as well as the multiplicative factors on the coordinatevalues.Let us understand the rotation about an arbitrary pointthrough an example. Suppose we have to rotate a triangle ABC by90 degree about a point (1, -1). The coordinates of the triangle areA (4, 0), B (8, 3) and C (6, 2). The triangle ABC can be represented in matrix as The point about which the triangle has to be rotated be P = (-1, 1) and the rotation matrix for 90 degree rotation is Now we can perform the rotation operation in three steps. In first step we will have to translate the arbitrary point to the origin. Let A’B’C’ be the new coordinates obtained after translation operation. Now the second step is to rotate the object. Let A’’B’’C’’ be new coordinates after applying rotation operation to A’B’C’, then In third step we translate back the coordinates The coordinates A, B, C is the required result. 153 CU IDOL SELF LEARNING MATERIAL (SLM)

9.3 OTHER TRANSFORMATIONS REFLECTION Reflection is the mirror image of original object. In other words, we can say that it is a rotation operation with 180°. In reflection transformation, the size of the object does not change.The following figures (figure 9.1, 9.2, 9.3 and 9.4) show reflections with respect to X and Y axes, and about the origin respectively. Figure 9.3: Reflection-1 Figure 9.4: Reflection-2 154 CU IDOL SELF LEARNING MATERIAL (SLM)

Fig 9.5: Reflection-3 Figure 9.6: Reflection-4 Object Transformation Objects can be transformed using 2D and 3D transformation techniques.  Line: Lines can be transformed by transforming the end points.  Plane (described by 3-points):It can be transformed by transforming the 3-points.  Plane (described by a point and normal): Point is transformed as usual. Special treatment is needed for transforming normal. 155 CU IDOL SELF LEARNING MATERIAL (SLM)

9.4 SHEAR A transformation that slants the shape of an object is called the shear transformation. There are two shear transformations X-Shear and Y-Shear. One shifts X coordinates values and other shifts Y coordinate values. However; in both the cases only one coordinate changes its coordinates and other preserves its values. Shearing is also termed as Skewing.A transformation that slants the shape of an object is called the shear transformation. Like in 2D shear, we can shear an object along the X-axis, Y-axis, or Z-axis in 3D. Figure 9.17: Shear X-Shear The X-Shear preserves the Y coordinate and changes are made to X coordinates, which causes the vertical lines to tilt right or left as shown in figure 9.6 and 9.7 Figure 9.18: Original Object 156 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 9.19: Object after x shear The transformation matrix for X-Shear can be represented as Xsh=⎡⎣⎢100shx10001⎤⎦⎥Xsh=[1shx0010001] Y' = Y + Shy.X X’ = X Y-Shear The Y-Shear preserves the X coordinates and changes the Y coordinates which causes the horizontal lines to transform into lines which slopes up or down as shown in the following figures 9.8 and 9.9 respectively. Figure 9.20: Original object 157 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 9.21: Object after y shear The Y-Shear can be represented in matrix from as Ysh⎡⎣⎢1shy0010001⎤⎦⎥Ysh[100shy10001] X’ = X + Shx . Y Y’ = Y 9.5 HOMOGENOUS COORDINATE SYSTEM To perform a sequence of transformation such as translation followed by rotation and scaling, we need to follow a sequential process.  Translate the coordinates,  Rotate the translated coordinates, and then  Scale the rotated coordinates to complete the composite transformation. To shorten this process, we have to use 3×3 transformation matrix instead of 2×2 transformation matrix. To convert a 2×2 matrix to 3×3 matrix, we have to add an extra dummy coordinate W.In this way, we can represent the point by 3 numbers instead of 2 numbers, which is called Homogenous Coordinate system. In this system, we can represent all the transformation equations in matrix multiplication. Any Cartesian point PX,Y can be converted to homogenous coordinates by P’ (Xh, Yh, h). 9.6 SUMMARY  In rotation transformation, an object is repositioned along a circular path in the xy plane. The rotation is performed with certain angle θ, known as rotation angle. 158 CU IDOL SELF LEARNING MATERIAL (SLM)

Rotation can be performed in two ways: about origin or about an arbitrary point called as rotation point or pivot point.  A transformation that slants the shape of an object is called the shear transformation. Like in 2D shear, we can shear an object along the X-axis, Y-axis, or Z-axis in 3D. there is a coordinate P.  You can shear it to get a new coordinate P', which can be represented in 3D matrix form as below. P’ = P.Sh X′=X+ShyxY+ShzxZX′=X+ShxyY+ShxzZ Y′=ShxyX+Y+shzyZY′=ShyxX+Y+shyzZ Z′=ShxzX+ShyzY+ZZ′=ShzxX+ShzyY+Z  Transformation matrix is a basic tool for transformation. A matrix with n x m dimensions is multiplied with the coordinate of objects. Usually 3 x 3 or 4 x 4 matrices are used for transformation.  The change in the order of transformation would lead to different results, as in general matrix multiplication is not cumulative, that is [A] . [B] ≠ [B] . [A] and the order of multiplication. The basic purpose of composing transformations is to gain efficiency by applying a single composed transformation to a point, rather than applying a series of transformation, one after another.  Homogeneous coordinates enables us to perform certain standard operations on points in Euclidean (XYZ) space by means of matrix multiplications. In Cartesian coordinate system, a point is represented by list ofpoints, where n is the dimension of the space. The homogeneous coordinates corresponding to the same point require n+1 coordinates.  Thus the two-dimensional point (x, y) becomes (x, y, 1) in homogeneous coordinates, and the three dimensional point (x, y, z) becomes (x, y, z, 1). The same concept can be applied to higher dimensions. For example, Homogeneous coordinates in a seven- dimensional Euclidean space have eight coordinates. In combined transformation, a translation matrix can be combined with a translation matrix, a scaling matrix with a scaling matrix and similarly a rotation matrix with a rotation matrix.  The scaling matrices and rotation matrices can also be combined as both of them are 3x3 matrices. If we want to combine a translation matrix with a scaling matrix and/or a rotation matrix, we will first have to change the translation matrix in homogenous coordinate system. Further in three dimensional, for uniform transformation we need to add a component to the vectors and increase the dimension of the transformation 159 CU IDOL SELF LEARNING MATERIAL (SLM)

matrices. This for components representation is known as homogenous coordinate representation.  The difference between this rotation transformation from the previous one .This one contains the additive terms as well as the multiplicative factors on the coordinate values. Let us understand the rotation about an arbitrary point through an example. Suppose we have to rotate a triangle ABC by 90 degree about a point (1, -1). The coordinates of the triangle are A (4, 0), B (8, 3) and C (6, 2).  To perform a sequence of transformation such as translation followed by rotation and scaling, we need to follow a sequential process which include (i) Translate the coordinates (ii) Rotate the translated coordinates, and then (iii) Scale the rotated coordinates to complete the composite transformation. 9.7 KEYWORDS  Reflection - is the mirror image of original object. In other words, we can say that it is a rotation operation with 180°. In reflection transformation, the size of the object does not change  Shear - A transformation that slants the shape of an object is called the shear transformation. There are two shear transformations X-Shear and Y-Shear.  Isometric Projection: All projectors make equal angles generally angle is of 30°.  Dimetric: In these two projectors have equal angles. With respect to two principal axis.  Trimetric: The direction of projection makes unequal angle with their principal axis.  Cavalier: All lines perpendicular to the projection plane are projected with no change in length.  Cabinet: All lines perpendicular to the projection plane are projected to one half of their length. These give a realistic appearance of object. 9.8 LEARNING ACTIVITY 1. Create a survey about two dimensional reflection method. ___________________________________________________________________________ ___________________________________________________________________________ 2. Create a session explaining homogeneous coordinate systems. ___________________________________________________________________________ ___________________________________________________________________________ 160 CU IDOL SELF LEARNING MATERIAL (SLM)

9.9 UNIT END QUESTIONS A. Descriptive Questions Short Questions 1. Define coordinate system 2. Define shear. 3. Define rotation in 2D graphics. 4. What do you mean by reflection in 2D graphics? 5. What is rotation in terms of 2D graphics? Long Questions 1. What is the difference between transformation about origin and rotation about an arbitrary point? 2. What are the steps involved in rotating an object about anarbitrary point? 3. Explain object transformation. 4. Explain 3D affine transformation. 5. Explain homogeneous coordinate system. B. Multiple Choice Questions 1. How can the shape of an object be distorted in shear transformation? a. By sliding b. By rotation c. By translation d. None of these 2. Which type of number values can hold for the shear parameter? a. Real b. Virtual c. Negative d. Positive 3. What kind of image of an object is formed in reflection transformation? 161 a. Mirror b. Direct c. Front d. Top CU IDOL SELF LEARNING MATERIAL (SLM)

4. When a transformation takes place on a 2D plane, what is it called? a. 1D transformation b. 2D transformation c. 3D transformation d. 4D transformation 5. What is the term for representing the point by 3 numbers instead of 2 numbers? a. Heterogeneous coordinate system b. Simple coordinate system c. Homogeneous coordinate system d. All of these Answers 1-a, 2-a, 3-a, 4-b, 5-c 9.10 REFERENCES References  Sawyer, F., Of Analemmas, Mean Time and the Analemmatic Sundial  Maynard, Patric (2005). Drawing distinctions: the varieties of graphic expression. Cornell University Press.  McReynolds, Tom; David Blythe (2005). Advanced graphics programming using openGL. Elsevier. Textbooks  Computer Graphics, Donald Hearn, M P. Baker, PHI  Procedural elements of Computer Graphics, David F. Rogers, Tata McGraw Hill.  Computer Graphics, Rajesh K. Maurya, Wiley – India. Websites  https://en.wikipedia.org/wiki/Orthographic_projection  https://www.brainkart.com/article/Two-dimensional-viewing_10216/  https://www.tutorialandexample.com/midpoint-circle-drawing-algorithm/ 162 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 10 THREE-DIMENSIONAL TRANSFORMATIONS PART I STRUCTURE 10.0 Learning Objectives 10.1 Introduction 10.2 Scaling 10.3 Translation 10.4 Rotation 10.5 Summary 10.6 Keywords 10.7 Learning Activity 10.8 Unit End Questions 10.9 References 10.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Illustrate the basics of 3-D geometry.  Explain the concept of three dimensional scaling method.  Describe the idea of translation.  Illustrate the concept of three dimensional rotation method. 10.1 INTRODUCTION The three-dimensional transformations are extensions of two-dimensional transformation. In 2D two coordinates are used, i.e., x and y whereas in 3D three co-ordinates x, y, and z are used. For three dimensional images and objects, three-dimensional transformations are needed. These are translations, scaling, and rotation. These are also called as basic transformations are represented using matrix. More complex transformations are handled using matrix in 3D. The 2D can show two-dimensional objects. Like the Bar chart, pie chart, graphs. But some more natural objects can be represented using 3D. Using 3D, we can see different shapes of the object in different sections. 163 CU IDOL SELF LEARNING MATERIAL (SLM)

In 3D when a translation is done we need three factors for rotation also, it is a component of three rotations. Each can be performed along any three Cartesian axis. In 3D also we can represent a sequence of transformations as a single matrix. 3D Geometry Three dimension system has three axis x, y, z. The orientation of a 3D coordinate system is of two types. Right-handed system and left-handed system. In the right -handed system thumb of right- hand points to positive z-direction and left- hand system thumb point to negative two directions. Following figure show right-hand orientation of the cube. Figure 10.1: 3 Dimensional Coordinate Using right-handed system co-ordinates of corners A, B, C, D of the cube Point A x, y, z Point B x, y, 0 Point C 0, y, 0 Point D 0, y, z Producing realism in 3D: The three-dimensional objects are made using computer graphics. The technique used for two Dimensional displays of three Dimensional objects is called projection. Several types of projection are available. Three Dimensional Transformations The geometric transformations play a vital role in generating images of three Dimensional objects with the help of these transformations. The location of objects relative to others can 164 CU IDOL SELF LEARNING MATERIAL (SLM)

be easily expressed. Sometimes viewpoint changes rapidly, or sometimes objects move in relation to each other. For this number of transformation can be carried out repeatedly. 10.2 SCALING Scaling is used to change the size of an object. The size can be increased or decreased. The scaling three factors are required Sx Sy and Sz. Sx=Scaling factor in x- direction Sy=Scaling factor in y-direction Sz=Scaling factor in z-direction. Figure 10.2: Original figure Figure 10.3: Enlarged figure Another image below shows other example of scaling. Figure 10.4: Original 165 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.5: Reduced form Matrix for Scaling Scaling of the object relative to a fixed point Following are steps performed when scaling of objects with fixed point (a, b, c). It can be represented as below: 1. Translate fixed point to the origin 2. Scale the object relative to the origin 3. Translate object back to its original position. Note: If all scaling factors Sx=Sy=Sz. Then scaling is called as uniform. If scaling is done with different scaling vectors, it is called a differential scaling. In figure 10.6 point (a, b, c) is shown, and object whose scaling is to done also shown in steps in figure10.7, figure10.8 and figure10.9. 166 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.6: Object and point for scaling Figure 10.7: Object transfer at origin Figure 10.8: Scaling of objects 167 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.9: Object shifted to the original position after scaling 10.3 TRANSLATION It is the movement of an object from one position to another position. Translation is done using translation vectors. There are three vectors in 3D instead of two. These vectors are in x, y, and z directions. Translation in the x-direction is represented using Tx. The translation is y- direction is represented using Ty. The translation in the z- direction is represented using Tz. If P is a point having co-ordinates in three directions (x, y, z) is translated, then after translation its coordinates will be (x1 y1 z1) after translation. Tx Ty Tz are translation vectors in x, y, and z directions respectively. x1=x+ Tx y1=y+Ty z1=z+ Tz Three-dimensional transformations are performed by transforming each vertex of the object. If an object has five corners, then the translation will be accomplished by translating all five points to new locations. Following figure 10.2 shows the translation of point figure 10.3 shows the translation of the cube. 168 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.10: Translation of a point Figure 10.11: Translational of the cube Matrix Representation of Point Translation Point shown in fig is (x, y, z). It became (x1,y1,z1) after translation. Tx Ty Tz are translation vector. 169 CU IDOL SELF LEARNING MATERIAL (SLM)

Example A point has coordinates in the x, y, z direction i.e., (5, 6, 7). The translation is done in the x- direction by 3 coordinate and y direction. Three coordinates and in the z- direction by two coordinates. Shift the object. Find coordinates of the new position. Solution Co-ordinate of the point are (5, 6, 7) Translation vector in x direction = 3 Translation vector in y direction = 3 Translation vector in z direction = 2 Translation matrix is Multiply co-ordinates of point with translation matrix = [5+0+0+30+6+0+30+0+7+20+0+0+1] = [8991] x becomes x1=8 y becomes y1=9 z becomes z1=9 10.4 ROTATION It is moving of an object about an angle. Movement can be anticlockwise or clockwise. 3D rotation is complex as compared to the 2D rotation. For 2D we describe the angle of rotation, but for a 3D angle of rotation and axis of rotation are required. The axis can be either x or y or z. Following figures shows rotation about x, y, z- axis 170 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.12: Rotation object X axis anticlockwise Figure 10.13: Rotation object Y axis anticlockwise 171 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 10.14: Rotation object X axis anticlockwise Rotation about Arbitrary Axis When the object is rotated about an axis that is not parallel to any one of co-ordinate axis, i.e., x, y, z. Then additional transformations are required. First of all, alignment is needed, and then the object is being back to the original position. Following steps are required. Translate the object to the origin Rotate object so that axis of object coincide with any of coordinate axis. Perform rotation about co-ordinate axis with whom coinciding is done. Apply inverse rotation to bring rotation back to the original position. Figure 10.15: Rotation about Arbitrary Axis Matrix for representing three-dimensional rotations about the Z axis Matrix for representing three-dimensional rotations about the X axis 172 CU IDOL SELF LEARNING MATERIAL (SLM)

Matrix for representing three-dimensional rotations about the Y axis 10.5 SUMMARY  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.  Transformation is a process of modifying and re-positioning the existing graphics. 3D Transformations take place in a three dimensional plane. ... Transformations are helpful in changing the position, size, orientation, shape etc of the object.  Properties of 3-D Transformation are Lines are preserved, Parallelism is preserved and Proportional distances are preserved.  Computer graphics, 3D Translation is a process of moving an object from one position to another in a three dimensional plane. Consider a point object O has to be moved from one position to another in a 3D plane. Tx defines the distance the Xold coordinate has to be moved.  A translation process moves every point a constant distance in a specified direction. It can be described as a rigid motion. A translation can also be interpreted as the addition of a constant vector to every point, or as shifting the origin of the coordinate system. 173 CU IDOL SELF LEARNING MATERIAL (SLM)

 The translation is y-direction is represented using Ty. The translation in the z- direction is represented using Tz. If P is a point having co-ordinates in three directions (x, y, z) is translated, then after translation its coordinates will be (x1 y1 z1) after translation.  A scaling transformation alters size of an object. In the scaling process, we either compress or expand the dimension of the object. Scaling operation can be achieved by multiplying each vertex coordinate (x, y) of the polygon by scaling factor sx and sy to produce the transformed coordinates as (x', y').  Scaling 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.  In computer graphics, scaling is a process of modifying or altering the size of objects. Scaling subjects the coordinate points of the original object to change. ... Scaling factor determines whether the object size is to be increased or reduced.  In Computer graphics, 3D Rotation is a process of rotating an object with respect to an angle in a three dimensional plane. Consider a point object O has to be rotated from one angle to another in a 3D plane. Let- Initial coordinates of the object O = (Xold, Yold, Zold).  Rotation in 3D is harder. In 2D, rotation is rotation about a point, which is usually taken to be the origin. In 3D, rotation is rotation about a line, which is called the axis of rotation. Think of the Earth rotating about its axis. 10.6 KEYWORDS  Scaling Factor - In computer graphics, scaling is a process of modifying or altering the size of objects. Scaling may be used to increase or reduce the size of object. Scaling subjects the coordinate points of the original object to change. Scaling factor determines whether the object size is to be increased or reduced.  3D geometry - Three-dimensional space is a geometric setting in which three values are required to determine the position of an element. This is the informal meaning of the term dimension. In mathematics, a sequence of n numbers can be understood as a location in n-dimensional space.  Cube - In geometry, a cube is a three-dimensional solid object bounded by six square faces, facets or sides, with three meeting at each vertex. The cube is the only regular hexahedron and is one of the five Platonic solids. It has 6 faces, 12 edges, and 8 vertices 174 CU IDOL SELF LEARNING MATERIAL (SLM)

 Projection - It is the process of converting a 3D object into a 2D object. It is also defined as mapping or transformation of the object in projection plane or view plane. The view plane is displayed surface.  Matrix - In mathematics, a matrix is a rectangular array or table of numbers, symbols, or expressions, arranged in rows and columns, which is used to represent a mathematical object or a property of such an object. 10.7 LEARNING ACTIVITY 1. Create a session on discussing 3D coordinate axis. ___________________________________________________________________________ ___________________________________________________________________________ 2. Create a session on explaining different methods of 3D transformation. ___________________________________________________________________________ ___________________________________________________________________________ 10.8 UNIT END QUESTIONS A. Descriptive Questions 175 Short Questions 1. What is scaling in 3D graphics? 2. What is transformation? 3. Define rotational method of 3D transformation. 4. What do you mean by 3D co-ordinates? 5. What is translation in simple words? Long Questions 1. Explain scaling in detail. 2. Explain translation with suitable diagrams. 3. Briefly describe rotation with diagrams. 4. Explain different types of transformations. 5. Describe the matrix representation of point translation B. Multiple Choice Questions 1. How one can change the size of an object? a. Shear transformation CU IDOL SELF LEARNING MATERIAL (SLM)

b. Scaling transformation c. Reflection transformation d. Parallel transformation 2. What changes can be done in the dimension of an object during scaling process? a. Expand b. Compress c. Expand or compress d. All of these 3. How many vectors are there in three dimensions? a. Zero b. One c. Two d. Three 4. How many types of transformations are there? a. Four b. Five c. Six d. Seven 5. Which are true properties of 3-dimensional transformation? a. Lines are preserved b. Parallelism is preserved c. Proportional distance is preserved d. All of these Answers 1-b, 2-c, 3-d, 4-b, 5-d 176 CU IDOL SELF LEARNING MATERIAL (SLM)

10.9 REFERENCES References  C. Coelho, M. Straforani, M. Campani \" Using Geometrical Rules and a priori Knowledge for the Understanding of Indoor Scenes\" Proceedings BMVC90, p.229- 234 Oxford, September 1990  Computer Graphics, Donald Hearn, M P. Baker, PHI.  Procedural elements of Computer Graphics, David F. Rogers,Tata McGraw Hill. Textbooks  Computer Graphics, Amarendra Sinha, A. Udai,, Tata McGrawHill.  Computer Graphics,A. P. Godase, Technical Publications Pune.  Rajesh K. Maurya Computer Graphics Wiley – India Websites  https://www.graphics.cornell.edu/about/what-computer-graphics  https://www.britannica.com/topic/computer-graphics  https://open.umn.edu/opentextbooks/textbooks/420 177 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 11 THREE-DIMENSIONAL TRANSFORMATIONS PART II STRUCTURE 11.0 Learning Objectives 11.1 Introduction 11.2 Shear Transformations 11.3 Reflection 11.4 Summary 11.5 Keywords 11.6 Learning Activity 11.7 Unit End Questions 11.8 References 11.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Illustrate the basics of three dimensional co-ordinates.  Illustrate of idea of three dimensional transformation.  Explain the concept of shear transformations.  Describe the idea of three dimensional reflection method. 11.1 INTRODUCTION Computer Graphics uses CAD. CAD allows manipulation of machine components which are 3 Dimensional. It also provides automobile bodies, aircraft parts study. All these activities require realism. For realism 3D is required. In the production of a realistic 3D scene from 2D is tough. It require three dimension, i.e., depth. Three dimensional transformation are  The world composed of three-dimensional images  Objects have height ,width ,and depth  The computer uses mathematical model to create the image 178 CU IDOL SELF LEARNING MATERIAL (SLM)

Coordinate System Three dimensional coordinate system can be viewed as extension of two dimensional coordinate system . The third dimension z-axis which represented at the right angel of x,y coordinate plan. A point can be described by triple (x, y, z) of coordinate values Ex./ Draw the figure: (0,0,3), (0,1,3), (2,0,3), (2,1,3), (0,1,0) (2,0,0), (2,1,0) 3D Vectors V= i+j+k OR (i,j,k) OR [ i j k ] Modulus of a Vector The modulus of a vector is given by the length of the arrow by using find length of line & term the modules of vector p Three Dimensional Models The techniques for generating different images of a solid object depend upon the type of object. Two viewing techniques are available for viewing three-dimensional objects. Geometry: It is concerned with measurements. Measurement is the location of a point concerning origin or dimension of an object. Topological Information: It is used for the structure of a solid object. It is mainly concerned with the formation of polygons with the help of points of objects or the creation of the object with polygons. Three Dimensional Transformations The geometric transformations play a vital role in generating images of three Dimensional objects with the help of these transformations. The location of objects relative to others can be easily expressed. Sometimes viewpoint changes rapidly, or sometimes objects move in relation to each other. For this number of transformation can be carried out repeatedly. 11.2 SHEAR TRANSFORMATIONS It is change in the shape of the object. It is also called as deformation. Change can be in the x - direction or y -direction or both directions in case of 2D. If shear occurs in both directions, the object will be distorted. But in 3D shear can occur in three directions. Matrix for shear 179 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 11.1: Shear in X direction Figure 11.2: Shear in Y direction Figure 11.3: Shear in Z direction 180 CU IDOL SELF LEARNING MATERIAL (SLM)

11.3 REFLECTION It is also called a mirror image of an object. For this reflection axis and reflection of plane is selected. Three-dimensional reflections are similar to two dimensions. Reflection is 180° about the given axis. For reflection, plane is selected (xy,xz or yz). Following matrices show reflection respect to all these three planes. Reflection Relative to XY Plane Figure 11.4: Reflection relative to XY plane Reflection Relative to YZ plane 181 CU IDOL SELF LEARNING MATERIAL (SLM)

Reflection relative to ZX plane. 11.4 SUMMARY  There are four main types of transformations: translation, rotation, reflection and dilation. These transformations fall into two categories: rigid transformations that do not change the shape or size of the preimage and non-rigid transformations that change the size but not the shape of the preimage  2D and 3D refer to the actual dimensions in a computer's workspace. 2D is 'flat', using the X & Y (horizontal and vertical) axis', the image has only two dimensions and if turned to the side becomes a line. 3D adds the 'Z' dimension. This third dimension allows for rotation and depth.  Shearing, also known as die cutting, is a process which cuts stock without the formation of chips or the use of burning or melting. ... Shearing-type operations include: blanking, piercing, roll slitting, and trimming. It is used for metal, fabric, paper and plastics.  Shearing is the process of separating the sheet metal into two or more pieces, normally by cutting along a line. Commonly used to cut into rectangular shapes but can produce other shaped parts.  Most commonly, shearing is used to cut a sheet parallel to an existing edge which is held square, but angled cuts can be made as well. For this reason, shearing is primarily used to cut sheet stock into smaller sizes in preparation for other processes. 182 CU IDOL SELF LEARNING MATERIAL (SLM)

 Three Dimensional Graphics Three Dimensional Transformations Scaling Rotation Rotation about Arbitrary Axis Inverse Transformations Reflection Shearing. 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.  A transformation that slants the shape of an object is called the shear transformation. There are two shear transformations X-Shear and Y-Shear.  It is transformation which changes the shape of object. The sliding of layers of object occur. The shear can be in one direction or in two directions. Shearing in the X- direction: In this horizontal shearing sliding of layers occur.  Reflection is a transformation which produces a mirror image of an object. The mirror image can be either about x-axis or y-axis. The object is rotated by180°. It is also called a mirror image of an object. For this reflection axis and reflection of plane is selected. Three-dimensional reflections are similar to two dimensions. Reflection is 180° about the given axis.  Computer graphics, 3D Translation is a process of moving an object from one position to another in a three dimensional plane. Consider a point object O has to be moved from one position to another in a 3D plane. Tx defines the distance the Xold coordinate has to be moved.  A reflection is a type of transformation. It 'maps' one shape onto another. When a shape is reflected a mirror image is created. If the shape and size remain unchanged, the two images are congruent.  The definition of a reflection is a thought or writing about something, particular in the past, or what one sees when looking into a mirror or body of water. An example of reflection is what a girl sees in the mirror when she puts on her makeup. 11.5 KEYWORDS  Topology - When referring to computer graphics, 3d models and the like, topology is the wireframe of a given object. ... Now, as I pointed out in a previous blog I said that optimization was important for computer graphics  Vector - Vector graphics are computer graphics images that are defined in terms of points on a Cartesian plane, which are connected by lines and curves to form polygons and other shapes.  Modulus - In computing, the modulo (sometimes called modulus, or mod) operation finds the remainder of division of one number by another. ... Although typically performed with a and n both being integers, many computing systems allow 183 CU IDOL SELF LEARNING MATERIAL (SLM)

other types of numeric operands. The range of numbers for an integer modulo of n is 0 to n - 1.  Reflection - Reflection in computer graphics is used to emulate reflective objects like mirrors and shiny surfaces. ... Approximate reflections can usually be computed faster by using methods such as environment mapping. Reflection on a shiny surface like wood or tile can add to the photorealistic effects of a 3D rendering.  Shear - Shearing deals with changing the shape and size of the 2D object along x-axis and y-axis. It is similar to sliding the layers in one direction to change the shape of the 2D object. It is an ideal technique to change the shape of an existing object in a two dimensional plane. 11.6 LEARNING ACTIVITY 1. Create a session on defining the modulus of a 3 dimensional vector system. ___________________________________________________________________________ ___________________________________________________________________________ 2. Create a survey in explaining shear transformation with reflection transformation. ___________________________________________________________________________ ___________________________________________________________________________ 11.7 UNIT END QUESTIONS A. Descriptive Questions Short Questions 1. What is shear? 2. Define 3D transformation 3. What is coordinate system 4. What is modulus of a vector? 5. What is geometry? Long Questions 1. Explain shear transformation 2. Explain reflection transformation with diagram. 3. Define 3 dimensional model. 4. Explain matrix representation of shear. 184 CU IDOL SELF LEARNING MATERIAL (SLM)

5. Explain matrix representation of reflection transformation method. B. Multiple Choice Questions 1. What do you call for the transformation that slants the shape of an object? a. 3D rotation b. 3D reflection c. Shear transformation d. Reflection transformation 2. How many degrees does one need to rotate an object to get 2D reflection transformation? a. 180 b. 120 c. 150 d. 90 3. What is a transformation that slants the shape of an object called? a. 3D Rotation b. 3D Reflection c. Shear transformation d. Reflection transformation 4. What is used to do translation? a. Translation vectors b. Force vectors c. Cannot be done d. None of these 5. Which axes can we can perform 3D rotation about? 185 a. X axes. b. X, Y axes. c. X and Z axes. d. X, Y, and Z axes. Answers 1-c, 2-a, 3-c, 4-a, 5-d CU IDOL SELF LEARNING MATERIAL (SLM)

11.8 REFERENCES References  Kirsti, Andersen. (2007). Geometry of an Art, p. xxx, Springer, ISBN.  B. Caprile & V. Torre (1990). \"Using Vanishing Points for Camera Calibration\", International Journal of Computer Vision.  H, Ditton. (1712). Treatise on Perspective. Textbooks  S, T, Barnard. (1983). Interpreting Perspective Images\", Artificial Intelligence.  D, Liebowitz & A, Zisserman. (1998). \"Metric Rectification for perspective images of planes\" ,IEEE Conf. Computer Vision and Pattern Recognition. Santa Barbara, CA.  R, T, Collins & R, Weiss. (1990). \"Vanishing Point Calculation as a Statistical Inference on the Unit Sphere\" Proceedings of ICCV3. Websites  http://www.faadooengineers.com/online-study/post/cse/computer-graphics/6/point- plotting  http://www.faadooengineers.com/online-study/post/cse/computer-graphics/6/the- incremental-dda-algorithm  http://vlabs.iitb.ac.in/vlabs-dev/labs/cglab/experiments/dda-algorithm-pvg/theory.html 186 CU IDOL SELF LEARNING MATERIAL (SLM)

UNIT - 12THREE-DIMENSIONAL TRANSFORMATIONS PART III STRUCTURE 12.0 Learning Objectives 12.1 Introduction 12.2 Projection 12.3 Parallel Projection 12.3.1 Orthographic Projection 12.3.2 Axonometric Projections 12.4 Perspective Projection 12.4.1 Frustum View Volume 12.4.2 Centre of Projection 12.4.3 Principle Vanishing Point 12.5 Summary 12.6 Keywords 12.7 Learning Activity 12.8 Unit End Questions 12.9 References 12.0 LEARNING OBJECTIVES After studying this unit, you will be able to:  Explain the concept of parallel projection.  Explain the idea of orthographic projection.  Illustrate the concept of axonometric projection.  Describe about perspective projection methods. 12.1 INTRODUCTION \"Axonometry\" means \"to measure along the axes\". In German literature, axonometry is based on Pohlke's theorem, such that the scope of axonometric projection could encompass every type of parallel projection, including not only orthographic 187 CU IDOL SELF LEARNING MATERIAL (SLM)

projection (and Multiview projection), but also oblique projection. However, outside of German literature, the term \"axonometric\" is sometimes used only to distinguish between orthographic views where the principal axes of an object are not orthogonal to the projection plane, and orthographic views in which the principal axes of the object are orthogonal to the projection plane. (In Multiview projection these would be called auxiliary views and primary views, respectively.) Confusingly, the term \"orthographic projection\" is also sometimes reserved only for the primary views. Thus, in German literature, \"axonometric projection\" might be considered synonymous with \"parallel projection\", overall; but in English literature, an \"axonometric projection\" might be considered synonymous with an \"auxiliary view\" (versus a \"primary view\") in a \"Multiview orthographic projection\". With an axonometric projection, the scale of an object does not depend on its location (i.e., an object in the \"foreground\" has the same scale as an object in the \"background\"); consequently, such pictures look distorted, as human vision and photography use perspective projection, in which the perceived scale of an object depends on its distance and location from the viewer. This distortion, the direct result of a presence or absence of foreshortening, is especially evident if the object is mostly composed of rectangular features. Despite this limitation, axonometric projection can be useful for purposes of illustration, especially because it allows for simultaneously relaying precise measurements. There are two type of projection parallel and perspective.  Parallel Projection : Parallel projections are used by architects and engineers for creating working drawing of the object, for complete representations require two or more views of an object using different planes. ...  Perspective Projection A parallel projection (or axonometric projection) is a projection of an object in three- dimensional space onto a fixed plane, known as the projection plane or image plane, where the rays, known as lines of sight or projection lines, are parallel to each other. Typically, an orthographic projection drawing consists of three different views: a front view, a top view, and a side view. Occasionally, more views are used for clarity. The side view is usually the right side, but if the left side is used, it is noted in the drawing. Steps used to create an orthographic projection. 1. Choose a front view. ... 2. Decide how many views are needed to completely describe the object. ... 3. Draw the visible features of the front view. 188 CU IDOL SELF LEARNING MATERIAL (SLM)

4. Draw projectors off of the front view horizontally and vertically in order to create the boundaries for the top and right side views. 12.2 PROJECTION It is the process of converting a 3D object into a 2D object. It is also defined as mapping or transformation of the object in projection plane or view plane. The view plane is displayed surface. Figure 12.1: Types of projection 12.3 PARALLEL PROJECTION Parallel Projection use to display picture in its true shape and size. When projectors are perpendicular to view plane then is called orthographic projection. The parallel projection is 189 CU IDOL SELF LEARNING MATERIAL (SLM)

formed by extending parallel lines from each vertex on the object until they intersect the plane of the screen. The point of intersection is the projection of vertex. Parallel projections are used by architects and engineers for creating working drawing of the object, for complete representations require two or more views of an object using different planes. Figure 12.2: Parallel projection Below figures shows three dimensional image of hut and its parallel projection. 190 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 12.3: Three dimensional image of hut Figure 12.4: Parallel projection of hut Exercise Figure 12.5 below shows an original object. What is its centre of projection from front and projected object? Figure 12.5: Object original 191 CU IDOL SELF LEARNING MATERIAL (SLM)

Solution Below figure 12.6 and figure 12.7 shows the centre of projection and its projected object. Figure 12.6: Centre of projection from front Figure 12.7: Projected object Types of Parallel Projection The various types of parallel projection are being shown below. Figure 12.8: Types of parallel projection Isometric Projection: All projectors make equal angles generally angle is of 30°. Dimetric: In these two projectors have equal angles. With respect to two principal axis. Trimetric: The direction of projection makes unequal angle with their principal axis. Cavalier: All lines perpendicular to the projection plane are projected with no change in length. Cabinet: All lines perpendicular to the projection plane are projected to one half of their length. These give a realistic appearance of object. 192 CU IDOL SELF LEARNING MATERIAL (SLM)

12.3.1 Orthographic Projection Orthographicprojection (sometimes referred to as orthogonal projection, used to be called analemma[a]) is a means of representing three-dimensional objects in two dimensions. It is a form of parallel projection, in which all the projection lines are orthogonal to the projection plane,[2] resulting in every plane of the scene appearing in affine transformation on the viewing surface. The obverse of an orthographic projection is an oblique projection, which is a parallel projection in which the projection lines are not orthogonal to the projection plane. The term orthographic is sometimes reserved specifically for depictions of objects where the principal axes or planes of the object are also parallel with the projection plane.[2] However, these are better known as primary views in Multiview projection. Furthermore, when the principal planes or axes of an object in an orthographic projection are not parallel with the projection plane, the depictions are sometimes referred to as axonometric. However, these are better known as auxiliary views. (Axonometric projection might be more accurately described as being synonymous with parallel projection.) Sub-types of primary views include plans, elevations and sections. Sub-types of auxiliary views might include isometric, dimetric and trimetric projections. A lens providing an orthographic projection is known as an object-space telecentric lens. Figure 12.9: Viewing volume in orthographic projection Thefigure displays volume in perspective projection. 193 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 12.10: Viewing volume in perspective projection 12.3.2 Axonometric Projections Axonometric projection is a type of orthographic projection used for creating a pictorial drawing of an object, where the object is rotated around one or more of its axes to reveal multiple sides. Figure 12.11: Classification of axonometric projection and some 3D projections 194 CU IDOL SELF LEARNING MATERIAL (SLM)

Three Types The three types of axonometric projection are isometric projection, dimetric projection, and trimetric projection, depending on the exact angle at which the view deviates from the orthogonal.[2][3] Typically in axonometric drawing, as in other types of pictorials, one axis of space is shown to be vertical. In isometric projection, the most commonly used form of axonometric projection in engineering drawing,[4] the direction of viewing is such that the three axes of space appear equally foreshortened, and there is a common angle of 120° between them. As the distortion caused by foreshortening is uniform, the proportionality between lengths is preserved, and the axes share a common scale; this eases one's ability to take measurements directly from the drawing. Another advantage is that 120° angles are easily constructed using only a compass and straightedge. In dimetric projection, the direction of viewing is such that two of the three axes of space appear equally foreshortened, of which the attendant scale and angles of presentation are determined according to the angle of viewing; the scale of the third direction is determined separately. Dimensional approximations are common in dimetric drawings.[clarification needed] In trimetric projection, the direction of viewing is such that all of the three axes of space appear unequally foreshortened. The scale along each of the three axes and the angles among them are determined separately as dictated by the angle of viewing. Dimensional approximations in trimetric drawings are common,[clarification needed] and trimetric perspective is seldom used in technical drawings. 195 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 12.12: The three axonometric views. The percentages show the amount of foreshortening. Limitations As with other types of parallel projection, objects drawn with axonometric projection do not appear larger or smaller as they lie closer to or farther away from the viewer. While advantageous for architectural drawings, where measurements must be taken directly from the image, the result is a perceived distortion, since unlike perspective projection, this is not how human vision or photography normally works. It also can easily result in situations where depth and altitude are difficult to gauge, as is shown in the illustration to the right. This visual ambiguity has been exploited in op art, as well as \"impossible object\" drawings. Though not strictly axonometric, M. C. Escher's Waterfall (1961) is a well-known image, in which a channel of water seems to travel unaided along a downward path, only to then paradoxically fall once again as it returns to its source. The water thus appears to disobey the law of conservation of energy. 12.4 PERSPECTIVE PROJECTION In perspective projection farther away object from the viewer, small it appears. This property of projection gives an idea about depth. The artist use perspective projection from drawing three-dimensional scenes. 196 CU IDOL SELF LEARNING MATERIAL (SLM)

Two main characteristics of perspective are vanishing points and perspective foreshortening. Due to foreshortening object and lengths appear smaller from the centre of projection. More we increase the distance from the centre of projection, smaller will be the object appear. Vanishing Point It is the point where all lines will appear to meet. There can be one point, two point, and three point perspectives. One Point: There is only one vanishing point as shown in the figure below. Two Points: There are two vanishing points. One is the x-direction and other in the y - direction as shown in figure below. Figure 12.13: Perspective projection-1 197 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 12.14: Perspective projection -2 Three Points: There are three vanishing points. One is x second in y and third in two directions. In Perspective projection lines of projection do not remain parallel. The lines converge at a single point called a centre of projection. The projected image on the screen is obtained by points of intersection of converging lines with the plane of the screen. The image on the screen is seen as of viewer's eye were located at the centre of projection, lines of projection would correspond to path travel by light beam originating from object. Anomalies in Perspective Projection It introduces several anomalies due to these object shape and appearance gets affected. Perspective foreshortening: The size of the object will be small of its distance from the centre of projection increases. Vanishing Point: All lines appear to meet at some point in the view plane. Distortion of Lines: A range lies in front of the viewer to back of viewer is appearing to six rollers. 198 CU IDOL SELF LEARNING MATERIAL (SLM)

Figure 12.15: Distortion of lines-1 Figure 12.16: Distortion of lines-2 Figure 12.17: Distortion of lines-3 199 CU IDOL SELF LEARNING MATERIAL (SLM)

12.4.1 Frustum View Volume In 3D computer graphics, the view frustum(also called viewing frustum) is the region of space in the modelled world that may appear on the screen; it is the field of view of a perspective virtual camera system. The view frustum is typically obtained by taking a frustum—that is a truncation with parallel planes—of the pyramid of vision, which is the adaptation of (idealized) cone of vision that a camera or eye would have to the rectangular viewports typically used in computer graphics. Some authors use pyramid of vision as a synonym for view frustum itself, i.e. consider it truncated. The exact shape of this region varies depending on what kind of camera lens is being simulated, but typically it is a frustum of a rectangular pyramid (hence the name). The planes that cut the frustum perpendicular to the viewing direction are called the near plane and the far plane. Objects closer to the camera than the near plane or beyond the far plane are not drawn. Sometimes, the far plane is placed infinitely far away from the camera so all objects within the frustum are drawn regardless of their distance from the camera. Viewing-frustum culling is the process of removing objects that lie completely outside the viewing frustum from the rendering process.[6] Rendering these objects would be a waste of time since they are not directly visible. To make culling fast, it is usually done using bounding volumes surrounding the objects rather than the objects themselves. 12.4.2 Centre of Projection In a perspective projection, the centre of projection is at a finite distance from the viewing plane. Parallel lines that are not parallel to the viewing plane, converge to a vanishing point. – A vanishing point is the projection of a point at infinity. 12.4.3 Principle Vanishing Point The vanishing point theorem is the principal theorem in the science of perspective. It says that the image in a picture plane π of a line L in space, not parallel to the picture, is determined by its intersection with π and its vanishing point. Theorem The vanishing point theorem is the principal theorem in the science of perspective. It says that the image in a picture plane π of a line L in space, not parallel to the picture, is determined by its intersection with π and its vanishing point. Some authors have used the phrase, \"the image of a line includes its vanishing point\". Guidobaldo del Monte gave several verifications, and Humphry Ditton called the result the \"main and Great Proposition\".Brook Taylor wrote the first book in English on perspective in 1714, which introduced the term \"vanishing point\" and was the first to fully explain the geometry of multipoint perspective, and historian Kirsti Andersen compiled these observation. She notes, in terms of projective 200 CU IDOL SELF LEARNING MATERIAL (SLM)


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook