Mavzu: Bеzе egri chizig‘i asosida multfilm qahramonlarini rasmini chizish


Download 248.98 Kb.
Sana27.01.2022
Hajmi248.98 Kb.
#512421
Bog'liq
2-amaliy mashg’ulot Mavzu Chizmalarda o‘lchamlar qo‘yish Reja , madaniyat, Mahsulot(1), public class Car, 9-1, 9-1, 1--maruza, metodika va texnologiya, 1.2-Mavzu (2), 1-мавзу, TASDIQLAYMAN kitob narxi, TASDIQLAYMAN kitob narxi, Пул ва Банк 3 та топширик маруза Otamurotov Sh, Презентация, 19-M

Labaratoriya ishi 3




Mavzu: Bеzе egri chizig‘i asosida multfilm qahramonlarini rasmini chizish


Gurux: 511-19 TTF


Bajardi: Xasanov Akbarali

Ishning maqsadi: Bеzе egri chizig‘i asosida multfilm qahramonlarini rasmini chizish

Personaj: Dale
#include
#include
#include
#include //Kutubxonalar
float t;
int i,s;
void floodfill(int x,int y,char BorderColor,char NewColor) // sohani bo’yash kodi
{
if(getpixel(x,y)!=BorderColor)
{
if(getpixel(x,y)!=NewColor)
{
putpixel(x,y,NewColor);
floodfill(x-1,y,BorderColor,NewColor);
floodfill(x+1,y,BorderColor,NewColor);
floodfill(x,y-1,BorderColor,NewColor);
floodfill(x,y+1,BorderColor,NewColor);
}}}
int beze(int x1,int y1,int x2, int y2,int x3,int y3,int x4,int y4,float &X,float &Y)
{
for(i=0;i<1000;i++)
{
t=i/1000.;
X=pow((1-t),3)*x1+3*t*(1-t)*(1-t)*x2+3*t*t*(1-t)*x3+t*t*t*x4;
Y=pow((1-t),3)*y1+3*t*(1-t)*(1-t)*y2+3*t*t*(1-t)*y3+t*t*t*y4;
putpixel(X,Y,s);
}}//beze egri chizig’ini chizish kodi
int main()
{
initwindow (1300,800); ochiladigan oynaning o’lchami
float X,Y;
s=0; // bu qysi rang bilan chiziq chizilishi “0 = qora”

floodfill(5,5,WHITE); //ekranni oq rangga bo’yash


beze(240,224,225,203,179,190,178,161,X,Y); //Bosh qismi
beze(178,161,179,148,206,147,212,124,X,Y);
beze(212,124,223,86,233,72,247,69,X,Y);
beze(258,62,244,67,242,71,249,94,X,Y);
beze(248,68,251,57,256,52,266,50,X,Y);
beze(254,54,266,37,278,36,296,50,X,Y);
beze(296,50,296,41,293,37,284,34,X,Y);
beze(284,34,296,34,303,38,311,51,X,Y);
beze(311,51,318,52,324,55,330,61,X,Y);
beze(333,75,325,51,333,38,346,27,X,Y);
beze(346,27,362,44,365,60,359,83,X,Y);
beze(332,45,315,21,313,23,311,51,X,Y); //Quloq
beze(315,52,315,47,317,44,323,39,X,Y);
beze(327,58,327,47,323,40,317,36,X,Y);
beze(348,43,338,53,338,74,344,74,X,Y);
beze(344,74,353,70,353,51,345,36,X,Y);
beze(247,94,262,72,272,64,286,63,X,Y);
beze(359,83,368,99,371,109,371,148,X,Y); //yuz

beze(328,163,335,159,339,155,340,146,X,Y);


beze(340,146,342,149,342,152,340,156,X,Y);
beze(340,156,347,153,351,149,354,139,X,Y);
beze(354,139,356,144,355,147,352,151,X,Y);
beze(352,151,368,143,386,148,389,167,X,Y);
beze(389,167,386,162,382,160,378,161,X,Y);
beze(378,161,391,170,391,181,384,194,X,Y);
beze(384,194,385,187,384,183,382,180,X,Y);
beze(382,180,373,213,352,225,315,225,X,Y);

beze(286,230,359,223,379,162,327,163,X,Y); //yuzni ichi


beze(327,163,368,71,285,44,251,150,X,Y);
beze(262,155,252,155,244,144,231,144,X,Y);
beze(200,164,200,138,252,138,252,164,X,Y); //burun

beze(252,164,253,190,200,190,200,164,X,Y);


beze(209,156,209,144,239,144,239,156,X,Y);
beze(239,156,239,169,209,169,209,156,X,Y);
beze(233,144,243,110,244,87,235,76,X,Y); //ko`z

beze(219,145,212,103,234,101,230,145,X,Y); //o`ng ko`z


beze(223,144,219,133,222,129,231,127,X,Y);
beze(277,167,286,155,304,159,323,160,X,Y); //chap ko`z
beze(281,164,273,99,322,99,319,161,X,Y);
beze(281,164,273,99,322,99,319,161,X,Y);
beze(286,162,275,124,318,124,308,160,X,Y);
beze(296,105,312,102,330,116,329,136,X,Y);
beze(250,158,261,158,277,178,287,178,X,Y);
beze(287,178,296,179,300,180,309,184,X,Y);
beze(207,178,216,206,260,206,289,179,X,Y);
beze(245,200,252,223,278,224,283,206,X,Y); //og`zi

beze(283,206,287,195,290,186,294,179,X,Y);


beze(257,198,260,206,260,209,264,207,X,Y); //tish

beze(264,207,266,208,272,207,275,203,X,Y);


beze(275,203,276,204,277,200,278,188,X,Y);
beze(258,217,261,213,266,210,273,212,X,Y); //til

beze(268,215,271,209,275,204,284,206,X,Y);


beze(313,225,341,242,354,277,344,305,X,Y); //yelka

beze(313,225,317,240,310,270,301,278,X,Y);


beze(295,229,297,236,281,254,272,255,X,Y);
beze(301,278,294,269,280,259,272,260,X,Y);
beze(272,260,283,269,287,283,284,288,X,Y);
beze(284,288,278,284,268,284,262,286,X,Y);

beze(344,305,330,295,302,293,296,297,X,Y);


beze(344,305,342,309,336,314,329,314,X,Y);
beze(331,299,333,323,319,347,303,350,X,Y); //qo`l

beze(303,350,285,350,232,310,227,294,X,Y);


beze(227,294,225,283,231,277,236,271,X,Y);
beze(230,282,221,261,242,248,251,268,X,Y);
beze(241,259,239,251,250,246,262,262,X,Y);
beze(254,254,252,246,265,243,271,255,X,Y);
beze(271,255,274,256,276,272,273,275,X,Y);
beze(273,275,265,277,258,283,261,291,X,Y);
beze(254,289,269,293,284,295,297,298,X,Y);
beze(297,298,308,301,313,305,321,314,X,Y);
beze(228,214,219,211,208,215,208,219,X,Y); //o`ng qo`l

beze(208,219,215,219,219,222,218,226,X,Y);


beze(218,226,211,225,204,224,199,226,X,Y);
beze(238,223,201,234,185,270,201,306,X,Y);
beze(201,306,207,295,219,283,230,281,X,Y);

//barmoq
beze(170,233,171,207,211,271,178,252,X,Y);


beze(181,230,184,213,205,253,189,250,X,Y);
beze(166,251,173,259,189,246,177,237,X,Y);
beze(177,237,171,231,160,231,156,238,X,Y);
beze(156,238,152,241,152,253,159,263,X,Y);
beze(159,263,162,266,164,272,165,278,X,Y);
beze(160,264,144,282,145,321,175,332,X,Y);
beze(176,254,172,269,183,294,201,306,X,Y);

beze(191,229,194,224,199,221,208,226,X,Y);


beze(177,276,181,320,174,362,155,406,X,Y);
beze(155,406,183,444,279,448,318,385,X,Y);
beze(318,385,312,378,302,361,304,349,X,Y);
beze(171,421,135,464,144,488,216,520,X,Y);
beze(216,520,186,511,159,527,162,536,X,Y);
beze(187,534,165,528,142,545,173,546,X,Y);
beze(173,546,186,544,224,544,241,542,X,Y);
beze(241,542,250,540,257,533,253,527,X,Y);
beze(253,527,252,524,251,521,251,515,X,Y);
beze(251,515,259,509,283,505,291,509,X,Y);
beze(260,428,258,473,286,518,334,534,X,Y);
beze(199,430,207,475,229,494,276,489,X,Y);
beze(312,395,358,446,367,486,352,526,X,Y);
beze(319,527,325,548,365,570,393,564,X,Y);
beze(369,553,413,582,430,562,376,538,X,Y);
beze(356,514,377,520,387,531,387,543,X,Y);
beze(317,400,334,397,348,389,359,371,X,Y); //dum

beze(359,371,353,392,341,416,328,414,X,Y);


beze(359,371,361,382,359,390,353,399,X,Y);
beze(353,399,358,397,361,393,365,384,X,Y);
beze(365,384,366,399,361,409,353,418,X,Y);
beze(353,418,357,419,361,418,366,415,X,Y);
beze(366,415,360,426,350,432,341,437,X,Y);

//sohalarni bo’yash



floodfill(277,210,s,RED);
floodfill(298,66,s,6);
floodfill(320,35,s,6);
floodfill(285,323,s,6);
floodfill(366,159,s,6);
floodfill(161,287,s,6);
floodfill(318,437,s,6);
floodfill(196,463,s,6);
floodfill(161,295,s,6);
floodfill(331,401,s,6);
floodfill(181,238,s,6);
floodfill(190,237,s,6);
floodfill(212,173,s,BLACK);
floodfill(227,136,s,BLACK);
floodfill(290,150,s,BLACK);
floodfill(278,197,s,BLACK);
floodfill(225,256,s,LIGHTRED);
floodfill(230,457,s,LIGHTRED);
floodfill(347,59,s,LIGHTRED);
floodfill(321,50,s,LIGHTRED);
floodfill(245,361,s,RED);
floodfill(309,278,s,RED);
floodfill(334,305,s,RED);
floodfill(296,247,s,14);
floodfill(204,233,s,14);
getch();
closegraph();
return 0;
}

Natij:

Download 248.98 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2022
ma'muriyatiga murojaat qiling