Last Updated
February 22, 2010
-
What sequence of OpenGL commands would you use to render a 2D animation of two moons orbiting a planet? Assume you have a function DrawDisk() which draws a disk at the origin.
- Write some opengl based pseudo code to draw the three hands (hours, minutes seconds) of a clock. The hands should move at appropriate speeds, assume you have a fixed frame rate of 25 fps. [you only need to write the draw and update functions]
- Outline the steps needed to render a textured object in OpenGL.
- Outline the steps needed to render an illuminated object in OpenGL.
- What is the ModelView matrix in OpenGL? What 3 functions are typically used to modify the ModelView matrix?
-
- OpenGL supports only Gouraud shading which generally renders specular reflection poorly. Describe a technique to render specular reflection more accurately under OpenGL.
- Why is a vertex array used in OpenGL programs?
- Describe specifically how each of these OpenGL primitives are used. (5 Marks)
- GL_LINES
- GL_LINE_STRIP
- GL_TRIANGLES
- GL_TRIANGLE_FAN
- GL_POLYGON
- How does OpenGL use the depth buffer for HSR?
- What is an OpenGL display list? Why is it used?
- A 3D game allows the user to select objects using the mouse. How might this object selection be accomplished using OpenGL.
- The diagram below represents Car driving across the screen and the wheels are spinning as the car moves. Write some pseudo code to illustrate how this scene would be rendered in OpenGL. It is particularly important that you clearly show the order and types of transformations that are used. [Assume that you have a function DrawDisc() which draws a unit disc at the origin]
- What is the ModelView matrix stack. What is it used for. What functions are used to manipulate the ModelView matrix stack?
- Describe the role of these openGL functions
- glPushMatrix(...)
- glVertex3f(...)
- glBegin(GL_TRIANGLE_FAN)
- SwapBuffers(g_hdc);
- glLoadIdentity();
- glRotatef(...);
- glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, ...);
- glNormal3fv(...);
- glEnable(GL_NORMALIZE);
© Ken Power 1996-2016