Page 127 - DCAP504_Computer Graphics
P. 127

Computer Graphics




                                             To move a point P that is located at (3, 4, 5) to a new location with distance (2, 4,
                                             6) units.
                                             Given, P= [3, 4, 5, 1]
                                             Dx=2, Dy=4, Dy=6



                                             We apply the translation transformation and obtain the result as








                                             Hence the result is the point P being shifted to a new position P’.


                          8.2.2    Scaling
                          The scaling in the x, y and z directions can be obtained by using the transformation matrix:

                                  Sx  0  0   0
                                            
                          S[x,y,z] =  0  Sy  0   0 
                                  
                                    0  0  Sz  0 
                                    0  0  0  1 
                                            
                          In the x, y and z directions the scaling factors S x, S y  and S z are applied as shown in the figure 8.9. The
                          letter S denotes the basic scaling matrix.

                                                           Figure 8.9 : 3-D Scaling




















                          The following sequences of transformations occur in the scaling process for a fixed point:
                          1.  The fixed point is translated to origin
                          2.  The object is scaled
                          3.  The fixed point is translated to its original position
                          8.2.3    Rotation

                          The rotation transformations in 3-D plane can be designated around any line in space. This is not true in
                          the case of 2-D rotations. So, an axis of rotation is specified for a 3-D rotation. The object rotates along
                          the angle of rotation.




                          120                     LOVELY PROFESSIONAL UNIVERSITY
   122   123   124   125   126   127   128   129   130   131   132