19-12-2012, 06:26 PM
PROJECTION OF 3D –IMAGE
[attachment=44499]
Algorithm:
1. Start the program.
2. Declare the variables using structure.
3. Create the function and get the function using create () function.
4. Get the coordinates and assign the values for the coordinates.
5. Define the drawcube () function.
6. Using rotate () function, rotation is performed.
7. End the program.
PROGRAM:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void fun(int xm,int ym,int xma,int yma,int x1,int y1,int x2,int y2)
{
rectangle(xm,ym,xma,yma);
rectangle(x1,y1,x2,y2);
line(xm,ym,x1,y1);
line(xm,yma,x1,x2);
line(xma,yma,x1,y2);
line(xma,ym,x2,y1);
getch();
}
[attachment=44499]
Algorithm:
1. Start the program.
2. Declare the variables using structure.
3. Create the function and get the function using create () function.
4. Get the coordinates and assign the values for the coordinates.
5. Define the drawcube () function.
6. Using rotate () function, rotation is performed.
7. End the program.
PROGRAM:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void fun(int xm,int ym,int xma,int yma,int x1,int y1,int x2,int y2)
{
rectangle(xm,ym,xma,yma);
rectangle(x1,y1,x2,y2);
line(xm,ym,x1,y1);
line(xm,yma,x1,x2);
line(xma,yma,x1,y2);
line(xma,ym,x2,y1);
getch();
}