Manav Rachna College of Engineering, Faridabad MCA IIIrd Semester MCA-301, Computer Graphics and Multimedia LIST OF PRACTICALS S.No. NAME OF PRACTICAL 1. Write a program to draw a “STAR”. done 2. Write a program to draw a “HUT”. done 3. Write a program to draw a “CLOCK” with a moving pendulum. Done 4. Write a program to draw “VARIOUS FACES”. Done 5. Write a program to divide axes into small portions or Grids. Done 6. Write a program to scan converting a straight line using DDA Algorithm. Done 7. Write a program to draw a “LINE” using Bresenham’s Algorithm. Done 8. Write a program to draw a “CIRCLE” using Bresenham’s Algorithm. Done 9. Write a program to draw a “CIRCLE” using Mid point circle Algorithm. Done 10. Write a program to draw a “PIE SLICE”. 11. Write a program to design a “MOVING FAN” with a regulator having different speeds. Done
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Manav Rachna College of Engineering, FaridabadMCA IIIrd Semester
MCA-301, Computer Graphics and Multimedia
LIST OF PRACTICALS
S.No. NAME OF PRACTICAL
1. Write a program to draw a “STAR”. done
2. Write a program to draw a “HUT”. done
3. Write a program to draw a “CLOCK” with a moving pendulum. Done
4. Write a program to draw “VARIOUS FACES”. Done
5. Write a program to divide axes into small portions or Grids. Done
6. Write a program to scan converting a straight line using DDA Algorithm. Done
7. Write a program to draw a “LINE” using Bresenham’s Algorithm. Done
8. Write a program to draw a “CIRCLE” using Bresenham’s Algorithm. Done
9. Write a program to draw a “CIRCLE” using Mid point circle Algorithm. Done
10. Write a program to draw a “PIE SLICE”.
11. Write a program to design a “MOVING FAN” with a regulator having different speeds. Done
12. Write a program to draw animation of a moving plane from left to right of a screen. Done
13. Write a program to shift the origin to the centre of the screen and display a rectangle in the fourth quadrant. Done
14. Write a program to draw a “JOKER”. Done
15. Write a program to find the product of two matrices.
16. Write a program to translate a 2-dimensional object.
17. Write a program to scale a 2-dimensional object.
18. Write a program to draw a HUT in a given boundary. Done
16. Write a program to draw a “POLYGONAL”.
17. Write a program to design a “MOVING Bicycle”.
18. Write a program in MATLAB to draw a Circle of unit radius.
19. Write a program in MATLAB for Creating a Plot.
20. Write a program in MATLAB for implementing Multiple Axis Regions (subplot).
21. Write a program in MATLAB for implementing Fill function for creating graph of a well-known object.
int gd=DETECT,gm,x1,x2,y1,y2,length,dx,dy,X,Y,i,absx,absy;initgraph(&gd,&gm,"c:\\tc\\bgi");printf("enter the value of x1");scanf("%d",&x1);printf("enter the value of x2");scanf("%d",&x2);printf("enter the value of y1");scanf("%d",&y1);printf("enter the value of y2");
int gd,gm,x,y;gd=DETECT;initgraph(&gd,&gm,"c:\\tc\\bgi");x=getmaxx()/2;y=getmaxy()/2;line(0,y,getmaxx(),y);line(x,0,x,getmaxy());rectangle(x+80,80,getmaxx()-80,y-80);circle(x-100,400,30);getch();closegraph();
Q 16. Write a program to translate a 2-dimensional object.Sol.#include<stdio.h>#include<conio.h>#include<graphics.h>void main(){ int gd,gm,x,y,x1,y1,x2,y2,x3,y3; gd=DETECT; initgraph(&gd,&gm,"c:\\tc\\bgi"); clrscr(); printf("Enter the 1coordinates of triangle"); scanf("%d%d",&x1,&y1); printf("Enter the 2coordinates of triangle"); scanf("%d%d",&x2,&y2); printf("Enter the coordinates of triangle"); scanf("%d%d",&x3,&y3);
line(x1,y1,x2,y2); line(x2,y2,x3,y3); line(x1,y1,x3,y3); getch(); cleardevice(); printf("Enter the translation factors"); scanf("%d%d",&x,&y);
Q17. Write a program to scale a 2-dimensional object.Sol. #include<graphics.h>#include<stdio.h>#include<conio.h>#include<math.h>#include<process.h>
void main(){
int gd,gp,x1,x2,x3,x4,y1,y2,y3,y4;float sx,sy;gd=DETECT;initgraph(&gd,&gp,"c:\\tc\\bgi");clrscr();printf("Enter the coordinates of triangle");scanf("%d%d",&x1,&y1);printf("Enter the coordinates of triangle");scanf("%d%d",&x2,&y2);
printf("Enter the coordinates of triangle");scanf("%d%d",&x3,&y3);
line(x1,y1,x2,y2);line(x2,y2,x3,y2);line(x3,y3,x1,y1);getch();cleardevice();printf("Enter the scaling factors");scanf("%d%d",&sx,&sy);x4=sx*x1-x1;y4=sy*y1-y1;