It is assumed the original student failed their test

For historical reasons, here are my suggested answers…

1.Why is it better to use the types glfloat instead of float ?

A: It doesn’t really matter, but for program readability and consistency across libraries it would be wise. If you don’t use the internal GL definitions there could be cross platform deployment issues.

2.What is the modelview matrix?

A: The model view matrix manipulates the object(s) (model) and not the observer position. If an observer takes one step closer or the object takes one step closer, the effect is the same, it just depends on whether you want to adjust the observer or the object (model).

3.What is the projection matrix?

A: The projection matrix is the same as the observer (viewpoint) matrix and includes any necessary clipping. See question 2.

4.What’s the difference between orthographic and perspective projection?

A: An orthographic view displays all lines and angles as their true length regardless of distance. This is the customary drawing used for floor plans or engineers “3 view” or “flat” drawings.

A perspective view gives an apparent dimension of depth by making distant objects smaller. This is how artists and “3d” drawings are made.

5.What is an identity matrix? Why and how is it used in game programming?

A: An identity matrix is used to neutralize all previous matrix calculations. If a matrix had been rotated and translated, then multiplying by the identity matrix would return everything to the normal view.

6.What are matrix stacks? Why and how are they used?

A: A matrix stack is a way of storing, or retrieving calculations. The stack is used as a FILO (first in last out) memory device. Storage is like pancakes, if you save a matrix (push it onto the stack), it will be at the top and a subsequent retrieval (pop from the stack) will return it. If several stores (pushes) occur without a “pop” (pull), then the original matrix slowly gets deeper and deeper in the stack. This is a fast and convenient way of storing previous calculations.

7.What does the following line of code mean:

glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); /* default, not needed */

A: 1) Use a single image buffer (no memory scratchpad or page swapping),

2) each pixel is represented by a RGB (red, green, blue) value.

8.What does the following line of code mean:

glutDisplayFunc(display); /* display callback, invoked when window opened (or redrawn) */

A: This assigns a user supplied routine called “display” for drawing and /or refreshing the screen. This user made routine will be the logical place for most of the drawing commands.

9.What’s the difference between glVertex3f, glVertex2f and glVertex3fv?

A: the number represents how many numbers make up

each logical point and the letter after the number is the

variable type.

2f = two floating point numbers for each coordinate

3f = three floating point numbers for each coordinate

3fv =

3 Expect three variables for each coordinate

f These coordinates are in “float” format (they always are).

v Vertex will be passed in as an array. Otherwise we would have to pass the X, Y and Z coordinates separately.

10.What is a viewport?Why is a viewport needed?

A: A viewport designates what portion of the screen will show the image. This allows the image to take up a certain size and position so that other information can also be located on screen.

11.What’s the advantage of using vertex arrays?

A: Vertex arrays allow calculations to made just once for each required coordinate. Multiple polygons may use the same pre-calculated values. For example, a pyramid only has 4 required vertexes that need to be calculated. But if we where to process individually all the endpoints for each face (polygon), we would have to calculate 12 points (3 points for each face).

12.What kind of vertex arrays are there?

Vertices are specified by giving their coordinates in two, three, or four dimensions. This is done using one of several versions of the Vertex command:

void Vertex[234][sifd] ( T coords ) ;

void Vertex[234][sifd]v ( T coords ) ;

13.What are normalvectors mainly used for?

A: To determine if a face is pointed in the direction of the viewer and therefore is visible and should be drawn. They are also sometimes used for shading (determining the angle that light strikes a surface).

Several of these questions are subject to more than one interpretation. Of course I do not claim to be the final authority on this subject, feel free to offer alternative information