BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/index.php)
-   Object Oriented Programming (http://bzupages.com/forumdisplay.php?f=322)
-   -   Program to construct a 3-dimensional bar (http://bzupages.com/showthread.php?t=14568)

bonfire 01-03-2011 03:04 PM

Program to construct a 3-dimensional bar
 
1 Attachment(s)
Program to construct a 3-dimensional bar


#include
#include
#include
#include

void main (int)
{
int gdriver=DETECT,gmode,errorcode; //Requesting auto-detection.
int midx,midy,x;
//Initializing graphics and local variables.
initgraph(&gdriver,&gmode,"d:\\bc3\\bgi");
//Reading result of initialization.
errorcode=graphresult();
if(errorcode!=grOk)
//An error occurred.
{
printf("Graphics error occurred : %s \n",grapherrormsg(errorcode));
printf("Press any key to stop : ");
getch();
exit(1); //Terminate the program due to error.
}

setfillstyle(EMPTY_FILL,0);
/*The above statement means that the setfillstyle function is used to
set the fill style of the 3-d bar as a blank.*/
bar3d(200,200,300,450,10,1);
getch();
closegraph();
}
This graphics program outputs a rectangular slab (cuboid) on the screen using the 'bar3d' command.


All times are GMT +5. The time now is 11:03 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.