These Program is draw the three dimensional image using bard3d graphics function. using maxx=getmaxx();
maxy=getmaxy(); it will get the center of the coordinate using these coordinate it will draw the three dimensional visualization image
Source code three Dimensional Image algorithm
#include
#include
#include
#include
int maxx,maxy,midx,midy;
void axis()
{
getch();
cleardevice();
line(midx,0,midx,maxy);
line(0,midy,maxx,midy);
}
void main()
{
int gd,gm,x,y,z;
clrscr();
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"c:/tc/bgi");
setfillstyle(0,getmaxcolor());
maxx=getmaxx();
maxy=getmaxy();
midx=maxx/2;
midy=maxy/2;
bar3d(midx-250,midy+150,midx-150,midy+225,20,4);
printf("\nEnter the Perspective Projection Vector");
scanf("%d%d%d",&x,&y,&z);
bar3d(midx-(x*5),midy-(y*9),midx-(x*3),midy-(y*5),10*z,4);
getch();
closegraph();
}
3-Dimensional Images Algorithm OUTPUT
maxy=getmaxy(); it will get the center of the coordinate using these coordinate it will draw the three dimensional visualization image
Source code three Dimensional Image algorithm
#include
#include
#include
#include
int maxx,maxy,midx,midy;
void axis()
{
getch();
cleardevice();
line(midx,0,midx,maxy);
line(0,midy,maxx,midy);
}
void main()
{
int gd,gm,x,y,z;
clrscr();
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"c:/tc/bgi");
setfillstyle(0,getmaxcolor());
maxx=getmaxx();
maxy=getmaxy();
midx=maxx/2;
midy=maxy/2;
bar3d(midx-250,midy+150,midx-150,midy+225,20,4);
printf("\nEnter the Perspective Projection Vector");
scanf("%d%d%d",&x,&y,&z);
bar3d(midx-(x*5),midy-(y*9),midx-(x*3),midy-(y*5),10*z,4);
getch();
closegraph();
}
3-Dimensional Images Algorithm OUTPUT
0 comments:
Post a Comment