Zbekiston respublikasi axborot texnologiyalar va kommunikatsiyalarini rivojlantirish vazirligi
Download 16.52 Kb.
|
1-topshiriq
- Bu sahifa navigatsiya:
- Vazifa
O`ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALAR VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI Kompyuter grafikasi fani bo`yicha LABORATORIYA ISHI-1 Bajardi: 222-18 guruh talabasi Komilov Xojiakbar Vazifa: Ismini 3D ko'rinishda yozish, ko'chirish va masshtablash funksiyalaridan foydalangan holda dasturini tuzish. Dastur kodi: Ko’chirish funksiyasi : #include #include double k[90][2]; void uchlar() { k[1][0]=100; k[1][1]=100; k[2][0]=150; k[2][1]=50; k[3][0]=150; k[3][1]=350; k[4][0]=100; k[4][1]=400; k[5][0]=350; k[5][1]=50; k[6][0]=300; k[6][1]=100; k[7][0]=300; k[7][1]=150; k[8][0]=350; k[8][1]=100; k[9][0]=200; k[9][1]=200; k[10][0]=250; k[10][1]=150; k[11][0]=250; k[11][1]=250; k[12][0]=200; k[12][1]=300; k[13][0]=250; k[13][1]=200; k[14][0]=200; k[14][1]=250; k[15][0]=100; k[15][1]=250; k[16][0]=100; k[16][1]=200; // A harfi uchun k[17][0]=500; k[17][1]=100; k[18][0]=550; k[18][1]=50; k[19][0]=450; k[19][1]=350; k[20][0]=400; k[20][1]=400; k[21][0]=600; k[21][1]=400; k[22][0]=650; k[22][1]=350; k[23][0]=620; k[23][1]=250; k[24][0]=570; k[24][1]=300; k[25][0]=430; k[25][1]=300; k[26][0]=480; k[26][1]=250; //Y harfi uchun k[69][0]=700; k[69][1]=100; k[70][0]=750; k[70][1]=50; k[71][0]=750; k[71][1]=200; k[72][0]=700; k[72][1]=250; k[73][0]=900; k[73][1]=250; k[74][0]=950; k[74][1]=200; k[75][0]=950; k[75][1]=50; k[76][0]=900; k[76][1]=100; k[77][0]=950; k[77][1]=350; k[78][0]=900; k[78][1]=400; k[79][0]=700; k[79][1]=400; k[80][0]=750; k[80][1]=350; k[81][0]=750; k[81][1]=300; k[82][0]=700; k[82][1]=350; k[27][0]=1000; k[27][1]=50; k[28][0]=1050; k[28][1]=100; k[29][0]=1300; k[29][1]=100; k[30][0]=1250; k[30][1]=50; k[31][0]=1000; k[31][1]=350; k[32][0]=1050; k[32][1]=400; k[33][0]=1300; k[33][1]=400; k[34][0]=1250; k[34][1]=350; // U harfi uchun k[35][0]=1350; k[35][1]=100; k[36][0]=1400; k[36][1]=50; k[37][0]=1400; k[37][1]=350; k[38][0]=1350; k[38][1]=400; k[39][0]=1550; k[39][1]=400; k[40][0]=1600; k[40][1]=350; k[41][0]=1600; k[41][1]=50; k[42][0]=1550; k[42][1]=100; // L harfi uchun k[43][0]=1650; k[43][1]=100; k[44][0]=1700; k[44][1]=50; k[45][0]=1700; k[45][1]=350; k[46][0]=1650; k[46][1]=400; k[47][0]=1800; k[47][1]=400; k[48][0]=1850; k[48][1]=350; k[49][0]=1850; k[49][1]=250; k[50][0]=1800; k[50][1]=300; k[51][0]=1900; k[51][1]=100; k[52][0]=1950; k[52][1]=50; k[53][0]=1950; k[53][1]=350; k[54][0]=1900; k[54][1]=400; k[55][0]=2050; k[55][1]=400; k[56][0]=2100; k[56][1]=350; k[57][0]=2100; k[57][1]=250; k[58][0]=2050; k[58][1]=300; // A harfi uchun k[59][0]=2250; k[59][1]=100; k[60][0]=2300; k[60][1]=50; k[61][0]=2200; k[61][1]=350; k[62][0]=2150; k[62][1]=400; k[63][0]=2350; k[63][1]=400; k[64][0]=2400; k[64][1]=350; k[65][0]=2220; k[65][1]=250; k[66][0]=2170; k[66][1]=300; k[67][0]=2330; k[67][1]=300; k[68][0]=2380; k[68][1]=250; } void kuchish() { int i, a=300, b=500; for(i=0;i<=88;i++) { k[i][0]=k[i][0]+a; k[i][1]=k[i][1]+b; } } void line() { setcolor(GREEN); // F harfi uchun line(k[1][0]*0.5,k[1][1]*0.5,k[2][0]*0.5,k[2][1]*0.5); line(k[2][0]*0.5,k[2][1]*0.5,k[3][0]*0.5,k[3][1]*0.5); line(k[3][0]*0.5,k[3][1]*0.5,k[4][0]*0.5,k[4][1]*0.5); line(k[4][0]*0.5,k[4][1]*0.5,k[1][0]*0.5,k[1][1]*0.5); line(k[1][0]*0.5,k[1][1]*0.5,k[2][0]*0.5,k[2][1]*0.5); line(k[2][0]*0.5,k[2][1]*0.5,k[5][0]*0.5,k[5][1]*0.5); line(k[5][0]*0.5,k[5][1]*0.5,k[6][0]*0.5,k[6][1]*0.5); line(k[6][0]*0.5,k[6][1]*0.5,k[1][0]*0.5,k[1][1]*0.5); line(k[5][0]*0.5,k[5][1]*0.5,k[6][0]*0.5,k[6][1]*0.5); line(k[6][0]*0.5,k[6][1]*0.5,k[7][0]*0.5,k[7][1]*0.5); line(k[7][0]*0.5,k[7][1]*0.5,k[8][0]*0.5,k[8][1]*0.5); line(k[8][0]*0.5,k[8][1]*0.5,k[5][0]*0.5,k[5][1]*0.5); line(k[9][0]*0.5,k[9][1]*0.5,k[10][0]*0.5,k[10][1]*0.5); line(k[10][0]*0.5,k[10][1]*0.5,k[11][0]*0.5,k[11][1]*0.5); line(k[11][0]*0.5,k[11][1]*0.5,k[12][0]*0.5,k[12][1]*0.5); line(k[12][0]*0.5,k[12][1]*0.5,k[9][0]*0.5,k[9][1]*0.5); line(k[13][0]*0.5,k[13][1]*0.5,k[14][0]*0.5,k[14][1]*0.5); line(k[14][0]*0.5,k[14][1]*0.5,k[15][0]*0.5,k[15][1]*0.5); line(k[15][0]*0.5,k[15][1]*0.5,k[16][0]*0.5,k[16][1]*0.5); line(k[16][0]*0.5,k[16][1]*0.5,k[13][0]*0.5,k[13][1]*0.5); line(k[17][0]*0.5,k[17][1]*0.5,k[18][0]*0.5,k[18][1]*0.5); line(k[18][0]*0.5,k[18][1]*0.5,k[19][0]*0.5,k[19][1]*0.5); line(k[19][0]*0.5,k[19][1]*0.5,k[20][0]*0.5,k[20][1]*0.5); line(k[20][0]*0.5,k[20][1]*0.5,k[17][0]*0.5,k[17][1]*0.5); line(k[17][0]*0.5,k[17][1]*0.5,k[18][0]*0.5,k[18][1]*0.5); line(k[18][0]*0.5,k[18][1]*0.5,k[22][0]*0.5,k[22][1]*0.5); line(k[22][0]*0.5,k[22][1]*0.5,k[21][0]*0.5,k[21][1]*0.5); line(k[21][0]*0.5,k[21][1]*0.5,k[17][0]*0.5,k[17][1]*0.5); line(k[23][0]*0.5,k[23][1]*0.5,k[24][0]*0.5,k[24][1]*0.5); line(k[24][0]*0.5,k[24][1]*0.5,k[25][0]*0.5,k[25][1]*0.5); line(k[25][0]*0.5,k[25][1]*0.5,k[26][0]*0.5,k[26][1]*0.5); line(k[26][0]*0.5,k[26][1]*0.5,k[23][0]*0.5,k[23][1]*0.5); // Y harfi uchun line(k[69][0]*0.5,k[69][1]*0.5,k[70][0]*0.5,k[70][1]*0.5); line(k[70][0]*0.5,k[70][1]*0.5,k[71][0]*0.5,k[71][1]*0.5); line(k[71][0]*0.5,k[71][1]*0.5,k[72][0]*0.5,k[72][1]*0.5); line(k[72][0]*0.5,k[72][1]*0.5,k[69][0]*0.5,k[69][1]*0.5); line(k[71][0]*0.5,k[71][1]*0.5,k[72][0]*0.5,k[72][1]*0.5); line(k[72][0]*0.5,k[72][1]*0.5,k[73][0]*0.5,k[73][1]*0.5); line(k[73][0]*0.5,k[73][1]*0.5,k[74][0]*0.5,k[74][1]*0.5); line(k[74][0]*0.5,k[74][1]*0.5,k[71][0]*0.5,k[71][1]*0.5); line(k[75][0]*0.5,k[75][1]*0.5,k[76][0]*0.5,k[76][1]*0.5); line(k[76][0]*0.5,k[76][1]*0.5,k[78][0]*0.5,k[78][1]*0.5); line(k[78][0]*0.5,k[78][1]*0.5,k[77][0]*0.5,k[77][1]*0.5); line(k[77][0]*0.5,k[77][1]*0.5,k[75][0]*0.5,k[75][1]*0.5); line(k[77][0]*0.5,k[77][1]*0.5,k[78][0]*0.5,k[78][1]*0.5); line(k[78][0]*0.5,k[78][1]*0.5,k[79][0]*0.5,k[79][1]*0.5); line(k[79][0]*0.5,k[79][1]*0.5,k[80][0]*0.5,k[80][1]*0.5); line(k[80][0]*0.5,k[80][1]*0.5,k[77][0]*0.5,k[77][1]*0.5); line(k[79][0]*0.5,k[79][1]*0.5,k[80][0]*0.5,k[80][1]*0.5); line(k[80][0]*0.5,k[80][1]*0.5,k[81][0]*0.5,k[81][1]*0.5); line(k[81][0]*0.5,k[81][1]*0.5,k[82][0]*0.5,k[82][1]*0.5); line(k[82][0]*0.5,k[82][1]*0.5,k[79][0]*0.5,k[79][1]*0.5); // Z harfi uchun line(k[27][0]*0.5,k[27][1]*0.5,k[28][0]*0.5,k[28][1]*0.5); line(k[28][0]*0.5,k[28][1]*0.5,k[29][0]*0.5,k[29][1]*0.5); line(k[29][0]*0.5,k[29][1]*0.5,k[30][0]*0.5,k[30][1]*0.5); line(k[30][0]*0.5,k[30][1]*0.5,k[27][0]*0.5,k[27][1]*0.5); line(k[29][0]*0.5,k[29][1]*0.5,k[30][0]*0.5,k[30][1]*0.5); line(k[30][0]*0.5,k[30][1]*0.5,k[31][0]*0.5,k[31][1]*0.5); line(k[31][0]*0.5,k[31][1]*0.5,k[32][0]*0.5,k[32][1]*0.5); line(k[32][0]*0.5,k[32][1]*0.5,k[29][0]*0.5,k[29][1]*0.5); line(k[31][0]*0.5,k[31][1]*0.5,k[32][0]*0.5,k[32][1]*0.5); line(k[32][0]*0.5,k[32][1]*0.5,k[33][0]*0.5,k[33][1]*0.5); line(k[33][0]*0.5,k[33][1]*0.5,k[34][0]*0.5,k[34][1]*0.5); line(k[34][0]*0.5,k[34][1]*0.5,k[31][0]*0.5,k[31][1]*0.5); line(k[35][0]*0.5,k[35][1]*0.5,k[36][0]*0.5,k[36][1]*0.5); line(k[36][0]*0.5,k[36][1]*0.5,k[37][0]*0.5,k[37][1]*0.5); line(k[37][0]*0.5,k[37][1]*0.5,k[38][0]*0.5,k[38][1]*0.5); line(k[38][0]*0.5,k[38][1]*0.5,k[35][0]*0.5,k[35][1]*0.5); line(k[37][0]*0.5,k[37][1]*0.5,k[38][0]*0.5,k[38][1]*0.5); line(k[38][0]*0.5,k[38][1]*0.5,k[39][0]*0.5,k[39][1]*0.5); line(k[39][0]*0.5,k[39][1]*0.5,k[40][0]*0.5,k[40][1]*0.5); line(k[40][0]*0.5,k[40][1]*0.5,k[37][0]*0.5,k[37][1]*0.5); line(k[39][0]*0.5,k[39][1]*0.5,k[40][0]*0.5,k[40][1]*0.5); line(k[40][0]*0.5,k[40][1]*0.5,k[41][0]*0.5,k[41][1]*0.5); line(k[41][0]*0.5,k[41][1]*0.5,k[42][0]*0.5,k[42][1]*0.5); line(k[42][0]*0.5,k[42][1]*0.5,k[39][0]*0.5,k[39][1]*0.5); // L harfi uchun line(k[43][0]*0.5,k[43][1]*0.5,k[44][0]*0.5,k[44][1]*0.5); line(k[44][0]*0.5,k[44][1]*0.5,k[45][0]*0.5,k[45][1]*0.5); line(k[45][0]*0.5,k[45][1]*0.5,k[46][0]*0.5,k[46][1]*0.5); line(k[46][0]*0.5,k[46][1]*0.5,k[43][0]*0.5,k[43][1]*0.5); line(k[46][0]*0.5,k[46][1]*0.5,k[47][0]*0.5,k[47][1]*0.5); line(k[47][0]*0.5,k[47][1]*0.5,k[48][0]*0.5,k[48][1]*0.5); line(k[48][0]*0.5,k[48][1]*0.5,k[45][0]*0.5,k[45][1]*0.5); line(k[47][0]*0.5,k[47][1]*0.5,k[48][0]*0.5,k[48][1]*0.5); line(k[48][0]*0.5,k[48][1]*0.5,k[49][0]*0.5,k[49][1]*0.5); line(k[49][0]*0.5,k[49][1]*0.5,k[50][0]*0.5,k[50][1]*0.5); line(k[50][0]*0.5,k[50][1]*0.5,k[47][0]*0.5,k[47][1]*0.5); // L harfi uchun line(k[51][0]*0.5,k[51][1]*0.5,k[52][0]*0.5,k[52][1]*0.5); line(k[52][0]*0.5,k[52][1]*0.5,k[53][0]*0.5,k[53][1]*0.5); line(k[53][0]*0.5,k[53][1]*0.5,k[54][0]*0.5,k[54][1]*0.5); line(k[54][0]*0.5,k[54][1]*0.5,k[51][0]*0.5,k[51][1]*0.5); line(k[54][0]*0.5,k[54][1]*0.5,k[55][0]*0.5,k[55][1]*0.5); line(k[55][0]*0.5,k[55][1]*0.5,k[56][0]*0.5,k[56][1]*0.5); line(k[56][0]*0.5,k[56][1]*0.5,k[53][0]*0.5,k[53][1]*0.5); line(k[55][0]*0.5,k[55][1]*0.5,k[56][0]*0.5,k[56][1]*0.5); line(k[56][0]*0.5,k[56][1]*0.5,k[57][0]*0.5,k[57][1]*0.5); line(k[57][0]*0.5,k[57][1]*0.5,k[58][0]*0.5,k[58][1]*0.5); line(k[58][0]*0.5,k[58][1]*0.5,k[55][0]*0.5,k[55][1]*0.5); // A harfi uchun line(k[59][0]*0.5,k[59][1]*0.5,k[60][0]*0.5,k[60][1]*0.5); line(k[60][0]*0.5,k[60][1]*0.5,k[61][0]*0.5,k[61][1]*0.5); line(k[61][0]*0.5,k[61][1]*0.5,k[62][0]*0.5,k[62][1]*0.5); line(k[62][0]*0.5,k[62][1]*0.5,k[59][0]*0.5,k[59][1]*0.5); line(k[59][0]*0.5,k[59][1]*0.5,k[60][0]*0.5,k[60][1]*0.5); line(k[60][0]*0.5,k[60][1]*0.5,k[64][0]*0.5,k[64][1]*0.5); line(k[64][0]*0.5,k[64][1]*0.5,k[63][0]*0.5,k[63][1]*0.5); line(k[63][0]*0.5,k[63][1]*0.5,k[59][0]*0.5,k[59][1]*0.5); line(k[65][0]*0.5,k[65][1]*0.5,k[66][0]*0.5,k[66][1]*0.5); line(k[66][0]*0.5,k[66][1]*0.5,k[67][0]*0.5,k[67][1]*0.5); line(k[67][0]*0.5,k[67][1]*0.5,k[68][0]*0.5,k[68][1]*0.5); line(k[68][0]*0.5,k[68][1]*0.5,k[65][0]*0.5,k[65][1]*0.5); } int main() { initwindow(2000,2000); uchlar(); line();
getch(); kuchish(); line(); getch();
closegraph(); return 0; } Download 16.52 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling