Page 143 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 143

Unit 8: Implementing of Scaling in 2D Transformation



                         Done");                                                                  Notes
                    getch();
                    goto Menu;
                    case ‘5’:
                      Matrix[0][0]=Matrix[0][0]*–1;
                      printf("
                         Done");
                    getch();
                    goto Menu;
                    case ‘6’:
                    Matrix[0][1]=1;
                    Matrix[1][1]=1;
                      printf("
                         Done");
                    getch();
                    goto Menu;
                    case ‘7’:
                    for(i=0;i<=points;i++)
                    {
                      temp=poly[i][0]*Matrix[0][0]+poly[i][1]*Matrix[1][0]+Matrix[2][0];
                     poly[i][1]=poly[i][0]*Matrix[0][1]+poly[i][1]*Matrix[1][1]+Matrix[2][1];
                    poly[i][0]=temp;
                    }
                    case ‘8’:
                    getch();
                   // closegraph();
                    exit(0);
                    }
                    setgraphmode(2);
                      display_cordinate(DARKGRAY,WHITE);
                      Translate_to_Relative(poly,points,–Xdis,–Ydis);
                      fill_poly(poly,points,CYAN,RED);
                    getch();
                    restorecrtmode();
                    do
                    {
                    clrscr();
                      printf("
                         Do you Want to Switch to MENU [Y|N]:- ");
                    ch=getche();
                      }while( (ch!= ‘Y’) && (ch!= ‘N’) );
                      if(ch== ‘Y’)


                                             LOVELY PROFESSIONAL UNIVERSITY                                   137
   138   139   140   141   142   143   144   145   146   147   148