Docsity

Perspective Projection - Computer Graphics - Old Exam Paper, Exams of Computer Graphics

Toggle sidebar
bg1
Cork Institute of Technology
Bachelor of Science (Honours) in Software Development and
Computer Networking – Award
(NFQ Level 8)
Autumn 2006
COMPUTER GRAPHICS
(Time: 2 Hours)
Instructions
Answer FOUR questions.
All questions carry equal marks.
Examiners: Ms. Helen Fagan
Dr. J. Buckley
Dr. A. Kinsella
Question 1
i. Write a display method for a 2D openGL program that draws a unit square centered at the
origin.
(6 marks)
ii. What code needs to be added to make of the following changes:
• rotate the square clockwise by 90 degrees around the z-axis
• scale the square by a factor of 2
• move the square so that it is centered at (2,2) (9 marks)
iii. How would you implement zooming in and out, in a 2D openGL program? Illustrate your
answer with some sample code.
(10 marks)
Question 2
i. What is meant by the aspect ratio of a rectangle? What code would you add to an openGL
program to guarantee that the viewport is always square? (8 marks)
ii. Explain what is meant by double buffering. Why is it used in animation? How would you
modify an openGL program to use double buffering? (7 marks)
iii. Explain what the methods glPushMatrix and glPopMatrix do. Give an example of why you
might use these methods. (10 marks)
pf2

Partial preview of the text

Download Perspective Projection - 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 and

Computer Networking – Award

(NFQ Level 8)

Autumn 2006

COMPUTER GRAPHICS

(Time: 2 Hours)

Instructions Answer FOUR questions. All questions carry equal marks.

Examiners: Ms. Helen Fagan Dr. J. Buckley Dr. A. Kinsella

Question 1

i. Write a display method for a 2D openGL program that draws a unit square centered at the origin. (6 marks) ii. What code needs to be added to make of the following changes:

  • rotate the square clockwise by 90 degrees around the z-axis
  • scale the square by a factor of 2
  • move the square so that it is centered at (2,2) (9 marks)

iii. How would you implement zooming in and out, in a 2D openGL program? Illustrate your answer with some sample code. (10 marks)

Question 2

i. What is meant by the aspect ratio of a rectangle? What code would you add to an openGL program to guarantee that the viewport is always square? (8 marks)

ii. Explain what is meant by double buffering. Why is it used in animation? How would you modify an openGL program to use double buffering? (7 marks)

iii. Explain what the methods glPushMatrix and glPopMatrix do. Give an example of why you might use these methods. (10 marks)

Question 3 i. Describe with the aid of a diagram the viewing volume used in a. Perspective projection. b. Parallel projection (10 marks)

ii. How would you specify one of the above viewing volumes in an openGL program? (8 marks)

iii. What is the Canonical viewing volume? Describe how clipping can be applied to this viewing volume. (7 marks)

Question 4

i. Describe the z-buffer algorithm for hidden surface removal. (10 marks)

ii. What changes are required in an openGL program to enable hidden surface removal? (5 marks)

iii. Describe either the DDA or Bresenham line drawing algorithm. What is the main disadvantage of the DDA algorithm? (10 marks)

Question 5

i. Describe the equations used for calculating specular and diffuse lighting. Draw a diagram to illustrate the vectors that must be known for each equation.

(10 marks)

ii. What is lateral inhibition and what effect does it have on computer graphics? (5 marks)

iii. Describe how you would add a spotlight to an openGL program? Explain with the aid of a diagram the parameters that may be set for a spotlight. (10 marks)