Computer Graphics Mini Project
Computer Graphics Mini Project
Computer Graphics Mini Project
Modern entertainment industry i.e. film and television has gained new heights
because of advances in animation, graphics and multimedia. Television
advertisements, cartoons serials, presentation and model designs - all use
animation and multimedia techniques.
Problem Statement: -
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
int main()
{
int gdriver = DETECT, gmode, err;
int i = 0, j, x, y, x1, y1, x2, y2;
if (err != grOk)
{
printf("Graphics Error: %s\n",
grapherrormsg(err));
return 0;
}
j = 0;
/* rain drops */
setlinestyle(DASHED_LINE, 1, 2);
while (i < 700)
{
line(x1, y1, x2, y2);
x1 = x1 + 20;
y2 = y2 + 50;
i++;
}
setcolor(DARKGRAY);
setlinestyle(SOLID_LINE, 1, 3);
setcolor(LIGHTBLUE);
delay(250);
/* drawing sea/river */
setlinestyle(SOLID_LINE, 1, 1);
setfillstyle(SOLID_FILL, LIGHTBLUE);
rectangle(0, getmaxy() / 2 + 150, getmaxx(), getmaxy());
floodfill(getmaxx() - 10, getmaxy() - 10, LIGHTBLUE);
/* rain drops */
setlinestyle(DASHED_LINE, 1, 2);
x1 = 10, i = y1 = 0;
x2 = 0, y2 = 70;
/* drawing boat */
setlinestyle(SOLID_LINE, 1, 1);
setcolor(BROWN);
setfillstyle(SOLID_FILL, BROWN);
sector(x, y, 180, 360, 50, 10);
getch();