Page 90 - DCAP504_Computer Graphics
P. 90

Unit 6: 2-D Transformation



               The figure 6.10 depicts translation and rotation.

                                           Figure 6.10: Translation and Rotation




















               As shown in figure  6.10, the square object is transformed using translation transformation. The
               rectangle remains as a rectangle even though the position of the rectangle is changed.  Similarly, as
               shown in figure 6.10, when the rectangle is rotated using rotation transform, the angle of the lines with
               respect to the origin varies, but the rectangle remains as a rectangle. Such transformations are called
               affine transformation.
               Affine transformation is useful while performing combination transformation. The combining of
               rotation and scaling transformation can also be called as rotation-enlargement transformation. Consider
               point coordinates P=(x, y).
               When rotation-enlargement transformation is applied to this point, the transformation point P'=(x', y’).

                   ' x  cos  α  −sin  α   0  x 
                                    
                                        
                   ' y = s  sin α  cos α   0  y
                                    
                  ' z      0  0  1   z  
               Where, ‘s’ is the scaling factor and α is the angle of rotation.
                   ' x   cos.x  α  − . sin  α 
                              y
                                 
                              y
                   ' y = s  sin.x  α + . cos α 
                                 
                  ' z      z     
               The equation is simplified as,
               x’=s( cos. x  α − . sin α )= . s(  cosα  x ) −  . s (  sin α ) y
                           y
               y’=s( sin.x  α + . cos α ) = .s(  sin α  x ) +  . s (  cosα ) y
                           y
               z’=s (z)
               Let,
               a = cos.s  α

               b = - sin.s  α
               Then,
               x’=ax + by
               y’=ax - by





                                        LOVELY PROFESSIONAL UNIVERSITY                           83
   85   86   87   88   89   90   91   92   93   94   95