0% found this document useful (0 votes)
3 views1 page

Exp 10.c

Uploaded by

TEJAS DALVI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Exp 10.c

Uploaded by

TEJAS DALVI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<graphics.

h>
#include<stdio.h>
#include<conio.h>
int gdriver=DETECT,gmode;
int x1,y1,x2,y2,dep,ch;
void main()
{
printf("Enter Top Left and Bottom right corner");
printf("\nEnter x1 coordinate:");
scanf("%d",x1);
printf("Enter y1 coordinate:");
scanf("%d",y1);
printf("Enter x2 coordinate:");
scanf("%d",x2);
printf("Enter y2 coordinate:");
scanf("%d",y2);
printf("Enter depth along z-axis:");
scanf("%d",dep);
printf("Choose and one projection\n\t1.Parallel Projection\n\t2.Perspective
Projection\nEnter your choice:");
scanf("%d",ch);
initgraph(&gdriver,&gmode,"C:\\TURBOC3\\BGI");
switch(ch)
{
case 1:
rectangle(x1,y1,x2,y2);
outtextxy(x1,y1-10,"Front View");
rectangle(x2+100,y1,x2+100+dep,y2);
outtextxy(x2+100,y1-10,"Side View");
rectangle(x1,y1-(y2-y1),x2,x1+dep-(y2-y1));
outtextxy(x2+100,y1-10,"Top View");
getch();
closegraph();
break;
case 2:
bar3d(x1,y1,x2,y2,dep,1);
getch();
closegraph();
break;
}
}

You might also like