Академический Документы
Профессиональный Документы
Культура Документы
}
orth();
}
void matrixhi()
{
int i,j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
mat[i][j]=0;
if(i==j)
{mat[i][j]=1;}
}
}
mat[0][2]=0.5*0.5;
//printf("%f\n",mat[0][2]);
mat[1][2]=0.5*1.732*0.5;
//printf("%f\n",mat[0][2]);
orth();
}
void change()
{
int i;
printf("Enter the option.\n 1.Orthographic\n2.Oblique \n3.Perspective");
scanf("%d",&i);
switch(i)
{case 1:matrix();
break;
case 2:matrixhi();
break;
case 3:matrixhi();
break;
}
}
void main()
{
int i=0,j=0;
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"");
bar3d(100,100,200,200,40,1);
//line(100,100,140,70);
pt[0][0]=100;
pt[0][1]=100;
pt[1][0]=200;
pt[1][1]=100;
pt[2][0]=200;
pt[2][1]=200;
pt[3][0]=100;
pt[3][1]=200;
pt[4][0]=140;
pt[4][1]=70;
pt[5][0]=240;
pt[5][1]=70;
pt[6][0]=240;
pt[6][1]=170;
pt[7][0]=140;
pt[7][1]=170;
pt[0][2]=1;
pt[1][2]=1;
pt[2][2]=1;
pt[3][2]=1;
pt[4][2]=1;
pt[5][2]=1;
pt[6][2]=1;
pt[7][2]=1;
change();
getch();
}