Docsity

Shading Model - Computer Graphics - Old Exam Paper, Exams of Computer Graphics

Toggle sidebar
bg1
Cork Institute of Technology
Bachelor of Science (Honours) in Software Development – Award
(NFQ Level 8)
Summer 2006
Computer Graphics
(Time: 3 Hours)
Instructions
Answer FIVE questions.
All questions carry equal marks.
Examiners: Ms. H. Fagan
Dr. M. O Cinneide
Mr. M. Donnelly
Q1. (i) Write the code to set up a display list that draws a unit square centred on (0,0).
Write the display function that uses this display list to draw a unit square centred at
(2, 2) and (-2, –2).
What code is required to set the projection plane so that both squares are visible?
(10 marks)
(ii) What matrix or series of matrices describes the following transformations?
(a) translation of 2 units on x-axis and 3 units on the y axis
(b) scaling by a factor of ½ on both axis
(c) rotating 90 degrees clockwise about the point (2,2) in 2D (5
marks)
(iii) What code is needed in an openGL program to guarantee that the viewport is always
square? (5 marks)
Q2. (i) Describe with the aid of a diagram the viewing volume used in perspective projection.
How would you specify this in an openGL program? Use some sample code to
illustrate your answer. (8 marks)
(ii) What information must be specified to include a camera in a 3-D scene? How is this
done in an openGL program? (5 marks)
(iii) Describe how the camera frame with its basis vectors u v and n are derived from this
information.
pf3

Partial preview of the text

Download Shading Model - Computer Graphics - Old Exam Paper and more Exams Computer Graphics in PDF only on Docsity!

Cork Institute of Technology

Bachelor of Science (Honours) in Software Development – Award

(NFQ Level 8)

Summer 2006

Computer Graphics

(Time: 3 Hours)

Instructions Answer FIVE questions. All questions carry equal marks.

Examiners: Ms. H. Fagan Dr. M. O Cinneide Mr. M. Donnelly

Q1. (i) Write the code to set up a display list that draws a unit square centred on (0,0). Write the display function that uses this display list to draw a unit square centred at (2, 2) and (-2, –2). What code is required to set the projection plane so that both squares are visible? (10 marks)

(ii) What matrix or series of matrices describes the following transformations? (a) translation of 2 units on x-axis and 3 units on the y axis (b) scaling by a factor of ½ on both axis (c) rotating 90 degrees clockwise about the point (2,2) in 2D ( marks)

(iii) What code is needed in an openGL program to guarantee that the viewport is always square? (5 marks)

Q2. (i) Describe with the aid of a diagram the viewing volume used in perspective projection.

How would you specify this in an openGL program? Use some sample code to illustrate your answer. (8 marks)

(ii) What information must be specified to include a camera in a 3-D scene? How is this done in an openGL program? (5 marks)

(iii) Describe how the camera frame with its basis vectors u v and n are derived from this information.

(7 marks)

Q3. (i) Describe briefly each of the processes applied to the vertices in a graphics system which has a pipeline architecture. (5 marks)

(ii) Outline Bresenham’s line draw algorithm. (8 marks)

(iii) What are the first three points on a line from (20,10) to (30,18) if you are using Bresenham’s algorithm to digitize the line? Show your calculations. (7 marks)

Q4. (i) Describe the equation used in the phong lighting model to calculate specular lighting. (5 marks)

(ii) What is the purpose of a shading model? What is the difference between the phong shading model and the gouraud shading model? (5 marks)

(iii) What code is required to add a single point source of light to an openGL program? How would you modify this code to: (a) change the light into a spotlight (b) periodically move the position of the light (10 marks)