You are on page 1of 1

UNIVERSITATEA TITU MAIORESCU FACULTATEA DE INFORMATICA Sesiunea Disciplina: Grafica pe calculator Model bilet examen

Student: Grupa: Data:

1. Prezentati cel putin 4 idei principale din referatul intocmit (2 pct). 2. Caracterizati grafica vectorial (2 pct). 3. Explicati modelele de culori RGB si CMYK (1 pct). 4. Sa se explice fiecare functie OpenGl utilizata in programul urmator (2 pct).
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. #include <GL/glut.h> void init() { glClearColor (0.0, 0.0, 0.0, 0.0); glShadeModel (GL_FLAT); } void display() { glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 0.0, 0.0); glBegin(GL_POLYGON); glVertex2f(200.0,200.0); glVertex2f(400.0,200.0); glVertex2f(400.0, 400.0); glEnd(); glFlush (); } void reshape (int w, int h) { glViewport (0, 0, (GLsizei) w, (GLsizei) h); 21. glMatrixMode (GL_PROJECTION); 22. glLoadIdentity (); 23. gluOrtho2D (0.0, (GLdouble) w, 0.0, (GLdouble) h); 24. } 25. int main(int argc, char** argv) 26. { 27. glutInit(&argc, argv); 28. glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); 29. glutInitWindowSize (600, 600); 30. glutInitWindowPosition (100,100); 31. glutCreateWindow (argv[0]); 32. init (); 33. glutDisplayFunc(display); 34. glutReshapeFunc(reshape); 35. glutMainLoop(); 36. return 0; 37. }

5. Explicati ce rezulta in urma testarii setului de comenzi (2 pct).


#include <GL/glut.h> #include <stdlib.h> #include <math.h> void Display(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_LINES); for(int i=0;i<100;++i) { glVertex3f(0,0,0); glVertex3f(1-i/100.0,i/100.0,0); } glEnd(); glFlush(); } int main(void) { glutCreateWindow("model"); glutDisplayFunc(Display); glColor3f(1,1,0); glutMainLoop(); return 0; }

You might also like