Professional Documents
Culture Documents
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. }