Page 157 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 157

Unit 9: Translation



            control unit also contains three translation buffers, in which are stored the most recently accessed   Notes
            virtual addresses, which, in many situations, enables the virtual translation/FIFO control unit
            to translate the virtual address using less memory accesses.

            9.5 The Inverse of a Translation

            To undo a translation by t x  , t y , t z  apply the matrix

                                   È  1  0  0  0˘
                                   Í            ˙
                              T  =  Í  0  1  0  0 ˙
                               –1
                                   Í  0  0  1  0˙
                                   Í            ˙
                                   Î Í -t x  -t y  -t z  1 ˚ ˙
            We can now complete scaling about an arbitrary fixed point and rotation about an arbitrary
            turn. To scale about F= [x f  y f  z f ] use the composition of matrices
                             È  1  0    0  0˘ Ès x  0  0  0˘ È 1  0  0  ˘ 0
                             Í  0  1    0  0 ˙ Í  0  s  0  0 ˙ Í 0  1  0  0 ˙
                                                         ˙ Í
                                            ˙ Í
                             Í Í  0  0  1  0˙ Í Í 0  0 y  s  0˙ Í 0  0  1  ˙ ˙ 0
                             Í              ˙ Í      z   ˙ Í          ˙
                             Î Í -x f  -y f  -z f  1 ˚ ˙ Î  0  0  0  1 Í x f  y f  z f  1 ˚ ˙
                                                         ˚ Î
            when multiplied out yields?

                                   È   s        0        0    0˘
                                   Í    x                      ˙
                                   Í   0        s y      0    0 ˙
                                   Í x 1 - s )  y 1 - s )  z 1 - s )  1 ˙
                                                       (
                                               (
                                      (
                                   Î  f   x   f    y   f    z  ˚
            So a scaled point [X Y Z 1] becomes,
                                         È   s x      0       0     0˘
                                         Í   0        s       0     0 ˙
                        [x y z 1] = [x y z 1]  Í   y              ˙
                                         Í   0        0       s     0˙
                                         Í                     z     ˙
                                         Î Í x 1 ( -  s )  y 1 ( -  s )  z 1( -  s )  1 ˚ ˙
                                                x
                                           f
                                                            f
                                                                 z
                                                    f
                                                         y
            In a similar manner you can determine that rotation about a pivot R = [Xr Y r ] results in
                               x = x r  + (x – y r ) cos θ – (y – y r ) sin θ
                               y = y r  + (x – y r ) cos θ – (x – x r ) sin θ
            Self Assessment Questions
               6.  Translation is one of the ……………………. a translation moves all points of an object.
               7.  Simple straight line is movement of the …………….. in x and y direction.
               8.  This function takes as parameters a reference to ………………… that holds the current
                 state of the transformation and the X and Y translation values.
               9.  ..…............. capable of reading from, and writing to virtual memory.

              10.  We can develop the matrix involved in a straight forward manner by considering the
                 translation of a ………………...

              11.  CPU translated address is known as …………………
                 (  a)  virtual address.         (b)  physical address.
                 (  c)  bus address.             (d)  None of these.



                                             LOVELY PROFESSIONAL UNIVERSITY                                   151
   152   153   154   155   156   157   158   159   160   161   162