



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Semester 1 Examinations 2009/
Module Code: COMP
School: Maths and Computing
Programme Title: Bachelor of Science (Honours) in Software Development & Bachelor of Science (Honours) in Software Development and Computer Networking
Programme Code: KSDEV_8_Y4 and KDNET_8_Y
External Examiner(s): Ms. D. Lawless Internal Examiner(s): Ms. Helen Fagan
Instructions: Answer 4 of 5
Duration: 2 hours
Sitting: Winter 2009
Requirements for this examination:
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the correct examination paper. If in doubt please contact an Invigilator.
Question 1
i) What is meant by the term Real Time Rendering? (3 marks) ii) Describe what is meant by each of the following terms: a) scan Conversion b) colour depth c) double buffering d) interlaced displays e) CIE Chromaticity Diagram (10 marks)
iii) What are the main properties associated with affine transformations. Why are they useful in computer graphics? (6 marks)
iv) Why are homogenous co-ordinates used to represent transformations in computer graphics? How is a 3D translation represented in a homogenous system? (6 marks)
Question 2
i) What changes would you make to the following code to get the desired result Assume that the drawSquare method draws a unit square centred at the origin.
a. How would you rotate this square 45 degrees and move it so that it is centred at (5,5). b. What change would you make if you also wanted to scale it by a factor of 2 c. Draw two similar squares rotated 45 degrees and scaled by ½ centered at (5,5) , and (-5,5). d. Animate the program so that both squares rotate about their centre in opposite directions. Assume a timer function is set up call onTimer(int n); (10 marks)
void display() { glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); // Add code drawSquare(); glFlush() }
Question 5
(i) Outline each of the main steps in the fixed pipeline. (12 marks)
(ii) What is meant by the programmable pipe-line and how is it achieved? (7 marks)
(iii) What are the main inputs and outputs into a vertex shader and a fragment shader? (6 marks)
GLAPI void APIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); GLAPI void APIENTRY glClear( GLbitfield mask ); GLAPI void APIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); GLuint glGenLists( GLsizei range ); void glAccum( GLenum op, GLfloat value ); void glBegin( GLenum mode ); void glCallList( GLuint list ); void glClear(int buffers); void glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); void glColor3f( GLfloat red, GLfloat green, GLfloat blue ); void glEnd( void ); void glEnable( int ); void glEndList( void ); void glLighti( GLenum light, GLenum pname, GLint param ); void glLoadIdentity( void ); void glMaterialf( GLenum face, GLenum pname, GLfloat param ); void glMatrixMode( GLenum mode ); void glNewList( GLuint list, GLenum mode ); void glOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, void GLdouble near_val, GLdouble far_val ); void glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); void glScalef( GLfloat x, GLfloat y, GLfloat z ); void glTexCoord2f( GLfloat s, GLfloat t ); void glTexImage2D( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); void glTexParameteri( GLenum target, GLenum pname, GLint param ); void glTranslatef( GLfloat x, GLfloat y, GLfloat z ); void glVertex2f( GLfloat x, GLfloat y ); void glViewport( GLint x, GLint y, GLsizei width, GLsizei height ); void glBindTexture( GLenum target, GLuint texture ); void glDeleteTextures( GLsizei n, const GLuint *textures); void glGenTextures( GLsizei n, GLuint *textures ); void glLightfv( GLenum light, GLenum pname, const GLfloat *params ); void glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); void glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value); void glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y)); void glutPostRedisplay();