Computer Graphics Question Paper
Computer Graphics
Course:Bachelor Of Science In Information Technology
Institution: Kca University question papers
Exam Year:2011
UNIVERSITY EXAMINATIONS: 2010/2011
THIRD YEAR EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 2304: COMPUTER GRAPHICS
DATE: APRIL 2011 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions
QUESTION ONE (30 MARKS)
a) Distinguish between OpenGL, GLUT and the APIs GX, AGL and WGL? (Marks 10)
b) Using a diagram, illustrate an OpenGL pipeline representing the flow of graphical information, as
it is processed from CPU to the frame buffer.(Marks 10)
c) Below is a sample OpenGL program. Explain the functions; glutInitDisplayMode() and
glutCreateWindow(). (Marks 10)
void main( int argc, char** argv )
{
int mode = GLUT_RGB|GLUT_DOUBLE;
glutInitDisplayMode( mode );
glutCreateWindow( argv[0] );
init();
glutDisplayFunc( display );
glutReshapeFunc( resize );
glutKeyboardFunc( key );
glutIdleFunc( idle );
glutMainLoop();
}
QUESTION TWO (20 MARKS)
a) What is meant by the term “double buffering” and for what purpose is it used? (Marks 10)
b) What is the difference between a frame buffer and a z-buffer? (Marks 5)
c) Describe the basic approach in texture mapping and how it complements/supplements shading.
(Marks 5)
2
QUESTION THREE (20 MARKS)
In computer Graphics, objects such as spheres are usually approximated by simpler objects constructed
from flat polygons (polyhedra).
a) Briefly describe the major geometrical primitives as used in Computer Graphics. (Marks 5)
b) Using lines of longitude and latitude, define a set of simple polygons that approximate a sphere
centered at the origin. Can you use only quadrilaterals or only triangles? (Marks 15)
QUESTION FOUR (20 MARKS)
Often, we display functions of the form y = f(x,z) by displaying rectangular mesh generated by the set
of values {f(xi,zj)} evaluated at regular intervals in x and z. Hidden-surface removal should be applied
because parts of the surface can be obscured from view by other parts.
Derive two algorithms, one using hidden-surface removal and the other using hidden-line removal, to
display such a mesh. (Marks 20)
QUESTION FIVE (20 MARKS)
a) Illustrate using figures how each of the following OpenGL commands may be rendered.
GL_POINTS, GL_LINE_STRIP, GL_LINES, GL_LINE_LOOP, GL_POLYGON,
GL_TRIANGLE_STRIP, GL_TRIANGLES, GL_TRIANGLE_FAN, GL_QUADS,
GL_QUAD_STRIP (Marks 10)
b) Below is a sample OpenGL program. Explain the functions;
drawRhombus(GLfloat color[])and glBegin(GL_QUADS)
void drawRhombus( GLfloat color[] )
{
glBegin( GL_QUADS );
glColor3fv( color );
glVertex2f( 0.0, 0.0 );
glVertex2f( 1.0, 0.0 );
glVertex2f( 1.5, 1.118 );
glVertex2f( 0.5, 1.118 );
glEnd();
}
(Marks 10)
More Question Papers
Exams With Marking Schemes