Name(مسلاا) :...………
University Id( عماجلا مقرلا) :...………..
Serial Number( لسلستلا مقرلا) :……….
Date(خ يراتلا) : / / , Level(ىوتسملا) :...……….
Summer Semester of 2019-1440H Academic Year
Computer Graphics Course 6803430-3, Final LAB Exam
رابتخلاا
يئاهِّنلا
يلمعلا ةدامل
بساحلاب تاموسرلا
Solutions – لحلا جذومن
*Important instructions that every student must read and take care of:
1.The violation of these instructions will affect the results of this exam and other exams.
2.You have to fill the blanks bellow with the required data.
3.You can't talk with anyone or do anything that will disrupt the exam system.
4.You can't bring any books or memories or papers or mobile phones inside the exam room.
5.You can't leave the exam room before an hour from the beginning of the exam.
6.It's prohibited to change the chair positions inside the exam room.
Question 1st Ques / 2 2nd Ques / 3 3rd Ques / 4 4th Ques / 1 Sum / 10 Mark
Corrector’s Name Teacher\ Mariah Sami Ahmed AbdulAziz Khayat Corrector’s Signature
Reviewer’s Name Teacher\ Mariah Sami Ahmed AbdulAziz Khayat Reviewer’s Signature
I wish you best of luck ;) T.Mariah Khayat
Kingdom of Saudi Arabia ةيدوعسلا ةيبرعلا ةكلمملا Ministry of Education ميلعتلا ةرازو
Umm AlQura University ىرقلا مأ ةعماج
Adham University College مضأب ةيعماجلا ةيلكلا
Computer Science Department للآا بساحلا مسق
2
Question One (لولأا لاؤسلا): [ / 2 ] Choose the best answer:
1-Which one of the following OpenGL primitives we can use to draw an empty circle, as the one shows in the following figure?
( لا ةبتكم رماوأ نم يأ OpenGL
(Primitives) ةمس ّرلا ف ح ّضوم وه امك ةغراف ةرئاد مسرل اهمادختسا نكمي ةيلاّتلا
)؟ةيلاتلاّ
a) glBegin(GL_POINTS);
b) glBegin(GL_POLYGON);
c) glBegin(GL_LINE_LOOP);
d) All of the above
2-Which one of the following OpenGL lighting commands considered to be correct for adding black lights to the left of the following three-dimensional torus?
لا ةبتكم ف ةيلاتلا ةءاضلإا رماوأ نم يأ(
OpenGL
؟ةيلاّ
تلا داعبلأا ةيثلاثلا تانودلا ةمسر نم ىسريلا ةهجلل دوسأ ءوض طيلستل ةحيحص ربتعت )
a)
GLfloat mat_specular[] = {0, 0, 0, 0};
GLfloat light_position[] = {0, 1, 0, 0};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
b)
GLfloat mat_specular[] = {0, 0, 0, 0};
GLfloat light_position[] = {1, 0, 0, 0};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
c)
GLfloat mat_specular[] = {0, 0, 0, 0};
GLfloat light_position[] = {0, -1, 0, 0};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
d) None of the above
3
Question Two (يناثلا لاؤسلا): [ / 3 ]
Use C++ language and OpenGL to draw the following figure:
( لا ةغل مادختساب
C++لا ةبتكمو
OpenGL: لا تلا لك ّ ّ
شلا مسرب موق )
The Answer of Question Two:
4
The Answer of Question Two:
5
Question Three (ثلاثلا لاؤسلا): [ / 4 ]
Using C++ and OpenGL draw a graphic program that has a 3D Red Teapot, and when the user clicks on the right button of the mouse the Teapot color changes to Blue and when the user clicks on the left button of the mouse the Teapot color changes to Yellow.
( لا ةغل مادختساب
C++لا ةبتكمو
OpenGLيوتحي موسر جمانرب مسرا رز لع مدختسملا طغضي امدنع ،داعبلأا ثلاث هاش دا ّرب لع
رفصلأا نولل داّ ربلا نول ربغتي سريلأا ةرأفلا رز لع مدختسملا طغضي امدنعو قرزلأا نولل ربغتي هاشلا داّرب نول نميلأا ةرأفلا )
The Answer of Question Three:
6
Question Four (عبارلا لاؤسلا): [ / 1 ]
Complete the following C++ and OpenGL program by adding the command for drawing a Cube by any size then display the output for the program.
مسر رمأ فيضأ ( لا ةغلب بوتكملا لاتلا جمان ربلل هيراتخت مجح يأب بعكملا
C++
لا ةبتكمو
OpenGL.جمان ربلل جرخملا ضرعب موق مث )
The Answer of Question Four:
Do Your Best 😉
I Really Wish You Get High Marks T.Mariah Sami Ahmed Khayat Teacher Assistant @ Adam University College