Page 149 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 149

Unit 9: Translation
            Kumar Vishal, Lovely Professional University


                                      Unit 9: Translation                                         Notes



             CONTENTS

             Objectives
             Introduction
             9.1   2–Dimensional Translation in C program
             9.2   3–Dimensional Translation in C program
             9.3   Translating with Matrices

             9.4   Translating Addresses
             9.5   The Inverse of a Translation
             9.6  Summary
             9.7  Keywords

             9.8   Review Questions
             9.9   Further Readings

            Objectives

            After studying this unit, you will be able to:
               •  Explain the 2-dimensional translation in c program

               •  Describe translating with matrices
               •  Explain the 3-dimensional translation in c program
               •  Describe translating addresses

               •  What is the inverse of a translation?

            Introduction

            Translation is one of the easiest transformations. A translation goes all points of an object
            a  fixed  distance  in  a  particular  direction.  It  can  also  be  stated  in  words  of  two  frames  by
            expressing the coordinate system of object in terms of translated frames. We can develop the
            matrix involved in a straightforward manner by considering the translation of a single frame.
                                       
            If  we are given a frame,  F =  (, , wo  a translated frame  would  be one that is  given by
                                      uv
                                           , )
                 
                     , )
            F =  (, ,uv wo  that is, the origin is moved, and the vectors stay the same. If we write O in
            terms of the previous frame by
            If we write O in terms of the previous frame by
                                                    
                                         O =  au +  bv +  cw + O
            then we can write the frame F in terms of the frame F by
                                                        
                                                    u
                                        È 1 000˘ È ˘     u È  ˘
                                                    
                                        Í 01 00   ˙ Í ˙  v  Í Í  ˙
                                                    v
                                                        Í
                                        Í         ˙ Í ˙  =   ˙
                                                    
                                        Í 00 10˙ Í ˙    Í w ˙
                                                    w
                                        Í         ˙ Í ˙  Í  ˙
                                                    O
                                        Î ab c   1 ˚ Î ˚  Î O ¢ ˚
                                             LOVELY PROFESSIONAL UNIVERSITY                                   143
   144   145   146   147   148   149   150   151   152   153   154