Posts

How To Create Flying Kite Animation in C Or C++ (Computer Graphics)

Image
                                                                                        PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON FLYING KITE ANIMATION SOURCE CODE: #include<stdio.h> #include<dos.h> #include<graphics.h> void main() {     int gd=DETECT,gm;     int color;     int x=10,y=1,inc_x=10,inc_y=10;     int poly[10];     initgraph(&gd,&gm,"C:\\TC\\BGI");     while(!kbhit())     {         x += inc_x;         if(x > getmaxx()-175)             inc_x = -5; if(x < 0 )     inc_x = 10; y += inc_y; if(y > 200)     inc_y ...

How To Create Concentric Ellipse Animation in C Or C++ (Computer Graphics)

Image
                                                                                         PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON CONCENTRIC ELLIPSE ANIMATION SOURCE CODE: #include<stdio.h> #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> void main() { int i,r1,r2,n,j=2,xr=200,yr=100; int gd=DETECT,gm; initgraph(&gd,&gm,"C:\\TC\\BGI"); printf("Enter The No. of Ellipse:"); scanf("%d",&n); r1=xr/n; r2=yr/n; for(i=0;i<n;i++) { setfillstyle(1,j); ellipse(300,200,0,360,xr,yr); if(j==10) j=2; xr=xr-r1; yr=yr-r2; j++; } getch(); }

How To Create Circles in Circles Animation in C Or C++ (Computer Graphics)

Image
                                                                                        PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON CIRCLES IN CIRCLE ANIMATION SOURCE CODE: #include<graphics.h> #include<conio.h> #include<dos.h>   main() {    int gd = DETECT, gm, x, y, color, angle = 0;    struct arccoordstype a, b;      initgraph(&gd, &gm, "C:\\TC\\BGI");    delay(2000);    while(angle<=360)    {       setcolor(BLACK);       arc(getmaxx()/2,getmaxy()/2,angle,angle+2,100);       setcolor(YELLOW);       getarccoords(&a);       circle(a.xstart,a.ysta...

How To Create a Restrict Mouse Pointer In a Circle in C Or C++ (Computer Graphics)

Image
                                                                                       PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON RESTRICT MOUSE POINTER IN A CIRCLE SOURCE CODE: #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<math.h> union REGS i, o; int initmouse() {    i.x.ax = 0;    int86(0X33, &i, &o);    return ( o.x.ax ); } void showmouseptr() {    i.x.ax = 1;    int86(0X33, &i, &o); } void hidemopuseptr() {    i.x.ax = 2;    int86(0X33, &i, &o); } void getmousepos(int *x, int *y) {    i.x.ax = 3;    int86(0X33, &i, &o);    *x...

How To Draw Parachute Animation in C Or C++ (Computer Graphics)

Image
                                                                                     PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON PARACHUTE ANIMATION SOURCE CODE: #include <stdio.h> #include <conio.h> #include <graphics.h> #include <dos.h>   int main() {         /* request auto detection */         int gdriver = DETECT, gmode, err;         int i, x, y;         /* initialize graphic mode */         initgraph(&gdriver, &gmode, "C:/TURBOC3/BGI");         err = graphresult();         if (err != grOk) {                 /* er...

How To Draw Helicopter Animation in C Or C++ (Computer Graphics)

Image
                                                                                                PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON HELICOPTER ANIMATION SOURCE CODE: #include<conio.h> #include<graphics.h> #include<dos.h> //Animation void Helicopter(); void Go(); void main() {   clrscr();   int gd=DETECT, gm;   initgraph(&gd, &gm,"C://TC//BGI");   Go();   Helicopter();   getch();   closegraph(); } //This Go is only to make it stand for some time  void Go(){ //...........     For Background   .........  for(int l=0;l<50;l++){   int b=0;                ...

How To Draw Cosine Wave Animation in C Or C++ (Computer Graphics)

Image
                                                                                          PROJECT BY (SIMPLIFY LEARN PROGRAMMING)  ON COSINE WAVE ANIMATION SOURCE CODE: #include <conio.h> #include <math.h> #include <graphics.h> #include <dos.h>   void main() {     int gd = DETECT, gm;     int angle = 0;     double x, y;       initgraph(&gd, &gm, "C:\\TC\\BGI");    line(0, getmaxy() / 2, getmaxx(), getmaxy() / 2);  /* generate a sine wave */  for(x = 0; x < getmaxx(); x+=3) {        /* calculate y value given x */      y = 50*sin(angle*3.141/180);      y = getmaxy()...