Posts

Showing posts from September, 2020

How To Draw Football Goal Animation in C++ (Computer Graphics)

Image
  PROJECT BY (SIMPLIFY LEARN PROGRAMMING)    ON FOOTBALL GOAL ANIMATION SOURCE CODE: #include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int x=0,gd=DETECT,gm,point[]={0,220,1600,220,1600,900,0,900,0,220}; float y=0; initgraph(&gd,&gm,"C:\\TC\\BGI"); setcolor(MAGENTA); settextstyle(6,HORIZ_DIR,6); outtextxy(200,250,"HI"); delay(1000); cleardevice(); settextstyle(7,VERT_DIR,1); outtextxy(200,50,"GET READY FOR ANIMATION"); delay(1000); cleardevice(); setcolor(GREEN); setfillstyle(SOLID_FILL,GREEN); fillpoly(5,point); setcolor(WHITE); circle(100,100,25); delay(1000); line(100,125,100,185); delay(1000); line(100,135,125,170); delay(1000); line(100,135,75,170); delay(1000); line(100,185,125,220); delay(1000); line(100,185,75,220); delay(1000); setcolor(RED); setfillstyle(SOLID_FILL,RED); fillellipse(135+x,210-y,10,10); for(

How To Draw Table Fan Animation in C++ (Computer Graphics)

Image
PROJECT BY  (SIMPLIFY LEARN PROGRAMMING)    ON TABLE FAN ANIMATION SOURCE CODE: #include<conio.h> #include<stdio.h> #include<dos.h> #include<graphics.h> void main() { int gd=DETECT,gm,i,m; initgraph(&gd,&gm,"C:\\TC\\BGI"); setbkcolor(RED); while(kbhit()==0) { for(i=80; i>=0;i-=20) { setcolor(BLUE); circle(320,240,65); circle(320,240,67); setfillstyle(SOLID_FILL,BLUE); bar(310,307,330,360); bar(290,360,350,375); setcolor(WHITE); setfillstyle(SOLID_FILL,WHITE); pieslice(320,240,i,i+40,60); pieslice(320,240,i+120,i+160,60); pieslice(320,240,i+240,i+280,60); setcolor(BLUE); circle(320,240,10); setfillstyle(SOLID_FILL,BLUE); floodfill(320,240,BLUE); delay(100); setcolor(0); setfillstyle(SOLID_FILL,0); pieslice(320,240,i,i+40,60); pieslice(320,240,i+120,i+160,60); pieslice(320,240,i+240,i+280,60); setcolor(BLUE); circle(320,240,10); setfillstyle(SOLID_FILL,BLACK); floodfill(

How To Draw Sunrise Animation in C++ (Computer Graphics)

Image
PROJECT BY  (SIMPLIFY LEARN PROGRAMMING)    ON SUNRISE  ANIMATION SOURCE CODE: #include<iostream.h> #include<conio.h> #include<graphics.h> #include<conio.h> #include<dos.h> void main() { void sun(); void mountain(); int gd,gm; gd=DETECT; initgraph(&gd,&gm,"C:\\TC\\BGI"); mountain(); sun(); getch(); closegraph(); } void mountain() { line(0,300,200,147); arc(225,165,30,150,30); line(250,148,400,300); line(350,250,498,151); arc(527,175,43,137,36); line(553,150,640,250); } void sun() { int i,j,k,l; for(i=230,k=150;i>100;i--,k++) { setcolor(YELLOW); for(j=30;j>0;j--) circle(340,i,j); setcolor(BROWN); mountain(); setcolor(YELLOW); arc(k,250,20,180,6); arc(k-10,250,20,180,6); l=k+50; setcolor(BLUE); arc(l+100,200,20,180,6); arc(l+90,200,20,180,6); arc(l+150,170,30,140,6); arc(l+140,170,30,140,6); delay(150); cleardevice(); } setcolor(BROWN); m

How To Draw a Bouncing Ball Animation in C++ (Computer Graphics)

Image
                                                  PROJECT BY  (SIMPLIFY LEARN PROGRAMMING)    ON BOUNCING BALL  ANIMATION SOURCE CODE: #include<dos.h> #include<iostream.h> #include<graphics.h> #include<math.h> #include<conio.h> void main()   {    int gd=DETECT,gm;    initgraph(&gd,&gm,"C:\\TC\\BGI");    float x=1,y=0.00000,j=0.5,count=0.1;    float r=15;    setcolor(14);    line(0,215,650,215);     sleep(1);     for(int k=0;k<=7;k++)      {       for(float i=90;i<270;i+=10)        {                 y=cos(((i*22/7)/180))/j;                 if(y>0)                 y=-y;                 x+=5;                 setcolor(14);                 setfillstyle(1,14);                 circle(x,y*100+200,r);                 floodfill(x,y*100+200,14);        delay(100);                 setcolor(0);                 setfillstyle(1,0);                 circle(x,y*100+200,r);                

How To Draw a Butterfly Animation in C (Computer Graphics)

Image
                                                    PROJECT BY  (SIMPLIFY LEARN PROGRAMMING)    ON BUTTERFLY  ANIMATION SOURCE CODE: #include<graphics.h> #include<conio.h> #include<stdlib.h> #include<dos.h> char *buff1,*buff2; void main() {     int gd=DETECT,gm;     void *buff;     int area1,area2,x,y,inc_x=10,inc_y=10;     initgraph(&gd,&gm,"c:\\tc\\bgi");     //  structure of butterfly      ellipse(240,80,115,65,10,40);//body      circle(240,40,10);   // face      circle(240,30,2);    // lips      circle(235,37,2);   // left eye      circle(245,37,2);   // right eye      ellipse(215,40,15,100,20,40);    //antenna      ellipse(265,40,85,165,20,40);    //antenna      ellipse(160,90,270,0,80,25);   //left wing      ellipse(160,60,0,90,80,25);      ellipse(160,75,270,90,15,40);   // wing border      ellipse(320,75,90,270,15,40);   //wing border      ellipse(320,90,180,270,80,25); //  right wing      ellipse(320,60,90,180,80,25);      setfillstyle

How To Draw a Windmill Animation in C++ (Computer Graphics)

Image
                                                    PROJECT BY  (SIMPLIFY LEARN PROGRAMMING)    ON WINDMILL  ANIMATION SOURCE CODE: #include<iostream.h> #include<conio.h> #include<stdio.h> #include<graphics.h> #include<math.h> #include<dos.h> void wind(float x[7],float y[7]); void main() { int gd=DETECT,gm; float x[7],y[7],maxx,maxy,xw1,yw1,xw2,yw2; float theta=30; initgraph(&gd, &gm, "C:\\TC\\bgi"); maxx=getmaxx(); maxy=getmaxy(); x[0]=maxx/2; y[0]=maxy/2; x[1]=y[4]=x[2]=-90; y[6]=y[5]=y[1]=60; y[2]=35; y[3]=-100; x[4]=20; x[3]=0; x[5]=90; x[6]=65; theta=theta*22/7/180; while(kbhit()==0) { wind(x,y); xw1=cos(theta)*x[1]+sin(theta)*y[1]; yw1=-sin(theta)*x[1]+cos(theta)*y[1]; xw2=cos(theta)*x[2]+sin(theta)*y[2]; yw2=-sin(theta)*x[2]+cos(theta)*y[2]; x[1]=xw1; y[1]=yw1; x[2]=xw2; y[2]=yw2; xw1=cos(theta)*x[3]+sin(theta)*y[3]; yw1=-sin(theta)*x[3]+cos(theta)*y[3]; xw2=cos(theta)*x[4]+sin(theta)*y[4]; yw2=-sin(theta)*x[4]+cos(theta)*y[4