Do you know that? Don�t undersell yourself to clients. next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Upwork (oDesk) test answers << General Programming category

Test answers for OpenGL Programming Test 2016

(78) Last updated: March 25
Upwork (oDesk) • General Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

78 NOT Answered Yet Test Questions:

(hold on, will be updated soon)
1. After a glRenderMode (GL_SELECT), no fragment are produced.

Answers:

• True

• False

2. If the viewport is 1024 by 768, the projection matrix is a 45 degree perspective matrix with the viewport ratio and the modelview matrix is the identity, what will be drawn on the screen when the following drawing code is entered?

void draw (void)
{
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();
    
    glTranslatef (0, 0, -10);
    
    glColor3f (1.0, 1.0, 0.0);
    
    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();
    glFlush ();
}

Answers:

• Yellow lines

• Yellow square

• Yellow rectangle

• This code is an invalid drawing function

• None of the above

3. Which of the following is typically applied to the modelview matrix stack?

Answers:

• glFrustrum

• glRotate

• gluPerspective

• glOrtho

• gluOrtho2d

4. What is the difference between glLoadTransposeMatrix and glLoadMatrix?

Answers:

• glLoadTransposeMatrix does not require any argument to transpose the matrix on top of the stack wheras glLoadMatrix does

• glLoadTransposeMatrix transposes the given matrix before loading it wheras glLoadMatrix does not

• glLoadTransposeMatrix loads the matrix in the transpose area of the GPU wheras glLoadMatrix does not

• None of the above

5. Is there any non-structured flow of control like "goto" in GLSL?

Answers:

• Yes

• No

6. What will be drawn by the following code?

    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 0);
    glEnd ();

Answers:

• A quad

• A polygon

• A line

• This code is invalid

• None of the above

7. Which color is defined by the following call?

    glColor3ub (0, 255, 0);

Answers:

• red

• blue

• green

• gray

• white

8. When glMultMatrix takes a matrix, how should it be ordered?

Answers:

• Row-major

• Column-major

• Mixed mode

• None of the above

9. Is the following a valid drawing function?

void draw (void)
{
    glClear (GL_COLOR_BUFFER_BIT);

    glMatrixMode (GL_PROJECTION);
    glLoadIdentity ();
    glPushMatrix ();
    gluPerspective (45.0, (float)frame.size.width / (float)frame.size.height,
                    2.0, 1000.0);

    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();
    glTranslatef (0, 0, -10);

    glColor3f (1.0, 1.0, 0.0);
    
    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();

    glFlush ();
}

Answers:

• Yes

• No

10. Consider the following code:

glTranslatef (1.0, 2.0, 3.0);
glRotatef (40, 1.0, 0.0, 0.0);

What will be the first transformation from a geometric point of view?

Answers:

• Translation

• Rotation

11. Which function should be used to upload a 2D texture to OpenGL?

Answers:

• glUploadTex

• glTexCreate2D

• glTexImage2D

• glBuildTexture2D

• glTexture

12. What does glClear do?

Answers:

• It clears all OpenGL buffers

• It clears the OpenGL buffers specified in an argument

• It sets the window color to black

• None of the above

13. Which of the following is not a valid argument to glBegin ()?

Answers:

• GL_POINTS

• GL_LINES

• GL_LINE_STRIP

• GL_TRIANGLES

• GL_QUADS_FAN

14. On what language is GLSL syntax based?

Answers:

• ruby

• C

• python

• Objective-C

• None of the above

15. What is gl_Vertex in a vertex shader?

Answers:

• An attribute

• An uniform

• A varying

• A constant

• None of the above

16. Can glNormal be called between glBegin and glEnd ?

Answers:

• Yes

• No

17. What will happen if you do the following?
glMatrixMode (GL_PROJECTION);

glRotatef (10, 1, 0, 0);

Answers:

• A bus error will result

• An OpenGL error will result

• A rotation matrix is multiplied with the current projection matrix

• The projection matrix will be filled with garbages

• None of the above

18. Which values can be used with glTexParameter and GL_TEXTURE_MAG_FILTER parameter names?

Answers:

• GL_NEAREST

• GL_FAR

• GL_BILINEAR

• GL_LINEAR

• GL_MIPMAP

19. When a matrix has been popped from the stack, is it possible to read it again?

Answers:

• Yes, in the backbuffer

• Yes, with the matrix history

• Yes, by pushing an empty matrix

• No

20. What does glGetMinmax do?

Answers:

• It gets minimum and maximum vertex values

• It gets minimum and maximum surface values

• It gets minimum and maximum texture values

• It gets minimum and maximum pixel values

• None of the above

21. Is the following code correct?

    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd (GL_QUADS);

Answers:

• Yes

• No

22. OpenGL can draw convex polygons. Can it draw non-convex ones?

Answers:

• Yes

• No

23. What will be the size of the quad drawn by the following code on the screen?

    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();

Answers:

• 1 pixel

• 1 cm

• 1 inch

• It depends on the projection and modelview matrices

• None of the above

24. Which of the following functions has an unsigned byte variant? (taking GLubyte as arguments)

Answers:

• glVertex

• glColor

• glNormal

• glTexCoord

• None of the above

25. Does gluProject use the current matrix stack?

Answers:

• Yes

• No

26. What does glPassThrough() do?

Answers:

• It passes polygon through the depth buffer

• It loads the accumulation buffer

• It places a marker in the feedback buffer

• It loads a texture

• None of the above

27. In which version of OpenGL, GLSL was introduced as a core feature?

Answers:

• 1.1

• 1.2

• 1.3

• 2.0

• 2.1

28. Is gluBeginPolygon the same as glBegin(GL_POLYGON)?

Answers:

• Yes

• No

29. Which of the following might be used to draw VBOs?

Answers:

• glDrawArrays

• glDrawRangeElements

• glDrawElements

• glDrawVBO

• None of the above

30. What is a proxy texture?

Answers:

• A server side texture

• A texture without pixel data

• A 3d texture

• None of the above

31. What is the common size of OpenGL matrices?

Answers:

• 2x2

• 3x3

• 4x4

• 3x4

• 4x3

32. What is true of the following code?

glPushMatrix ();
glLoadIdentity ();
glTranslatef (1.0, 2.0, 4.0);
glPopMatrix ();

Answers:

• After this code has been executed, the matrix stack will be restored to its original state.

• This code has a syntax error.

• Load identity cannot appear after a push matrix.

• None of the above is true

33. How can you access the current modelview matrix?

Answers:

• With glModelviewMatrix

• With glGetMatrix

• With glReadMatrix

• With glStack

• None of the above

34. What is a display list?

Answers:

• A buffer object

• A list of commands

• A list of vertices

• None of the above

35. Which of the following are valid picking methods?

Answers:

• Back buffers

• Select buffers

• Automatic selection

• Render buffers

• None of the above

36. What image format does OpenGL understand?

Answers:

• png

• bmp

• tiff

• tga

• OpenGL cannot read images directly

37. Which function should be used to specify the coordinates of a point?

Answers:

• glPoint

• glCoord

• glVertex

• glPointCoord

• None of the above

38. Who created OpenGL?

Answers:

• Sun

• Microsoft

• SGI

• Apple

• Dell

39. glOrtho is used to define a _________ matrix.

Answers:

• modelview

• projection

• texture

• view

• model

40. What does glFrustum do?

Answers:

• It multiplies the current matrix by a translation matrix

• It multiplies the current matrix by a perspective matrix

• It multiplies the current matrix by a texture matrix

• It multiplies the current matrix by a color matrix

• None of the above

41. Which of the following is faster?

Answers:

• glBegin, glVertex, etc.

• Vertex buffer objects

• Vertex arrays

• None of the above

42. What does glActiveTexture do?

Answers:

• It changes the active texture unit

• It queries the active texture unit

• It overrides the current texture unit

• None of the above

43. What should be added to make this drawing function valid?

void draw (void)
{
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
    glTranslatef (0, 0, -10);
    
    glColor3f (1.0, 1.0, 0.0);
    
    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();
    
    glFlush ();
}

Answers:

• It is already valid

• glPushMatrix ()

• glLoadIdentity ()

• glPopMatrix ()

• None of the above

44. What is true of OpenGL?

Answers:

• It is a pixel precise specification

• It has numerous implementations

• It can be fully implemented in software

• None of the above is true

45. Which color is defined by the following call?

    glColor3f (1.0, 0.0, 0.0);

Answers:

• blue

• gray

• white

• red

• green

46. What is the first argument of glRotate?

Answers:

• The angle in radians

• The angle in degrees

• The center vector

• None of the above

47. What is the difference between statements A and B?

A: gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;

B: gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

Answers:

• They are equivalent

• The former has a syntax error whereas the latter has not any

• The former is valid whereas the latter is not

• None of the above

48. Is the following a valid drawing function?

void draw (void)
{
    glClear (GL_COLOR_BUFFER_BIT);

    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();

    glFlush ();
}

Answers:

• Yes

• No

49. Is the following code valid?

    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();
    glTranslatef (0, 0, -10);

Answers:

• Yes

• No

50. Which function should be used to specify the value of a sampler1D?

Answers:

• glSampler1D

• glSamplerUniform

• glUniform1i

• glSetSampler

• None of the above

51. What should be the render mode to use glLoadName ()?

Answers:

• GL_RENDER

• GL_SELECT

• GL_FEEDBACK

• None of the above

52. What is usually the best texture format for upload?

Answers:

• GL_UNSIGNED_BYTE

• GL_UNSIGNED_SHORT

• GL_UNSIGNED_INT_8_8_8_8_REV

• GL_INT

• GL_FLOAT

53. Which primitives may be used to draw a circle?

Answers:

• Polygon

• Lines

• Quads

• Triangles

• None of the above

54. In Windows, what API will you use to get an OpenGL context?

Answers:

• agl

• wgl

• glX

• None of the above

55. What is vsync?

Answers:

• Synchronization with vertex arrays

• Synchronization with the monitor refresh rate

• Synchronization with VBO

• Synchronization with the windows server

• None of the above

56. What does glBitmap do?

Answers:

• It loads a bitmap file

• It loads a png file

• It draws a bitmap

• It creates a texture

• None of the above

57. What is a varying variable?

Answers:

• A variable passed from the C code to the vertex shader

• A variable passed from the C code to the fragment shader

• A variable passed from the vertex shader to the fragment shader

• A variable passed from the fragment shader to the vertex shader

• None of the above

58. What is blending?

Answers:

• Texturing

• Layer composition

• Geometry transformation

• None of the above

59. With depth test enabled, will the following drawing code work for depth testing?

void draw (void)
{
    glClear (GL_COLOR_BUFFER_BIT);
    glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
    
    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();
    glTranslatef (0, 0, -10);
    
    glColor3f (1.0, 1.0, 0.0);
    
    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 1);
    glVertex2i (-1, 0);
    glEnd ();
    glFlush ();
}

Answers:

• Yes

• No

60. Which of the following is not a valid argument to glMatrixMode ?

Answers:

• GL_COLOR

• GL_PROJECTION

• GL_TEXTURE

• GL_DEPTH

• GL_MODELVIEW

61. How do you initialize the name stack?

Answers:

• Using glCreateStack ()

• Using glInitNames ()

• Using glPushMatrix ()

• None of the above

62. What is the purpose of glTexCoord?

Answers:

• To specify the origin and size of a texture

• To associate a texture coordinate with a vertex or raster position

• To generate a UV map from a 3D model

• To generate a coordinate grid for the current texture

• None of the above

63. What does gluOrtho2D do?

Answers:

• It sets the eye position

• It defines a projection matrix

• It defines a modelview matrix

• None of the above

64. What will be drawn by the following code?

    glBegin (GL_QUADS);
    glVertex2i (1, 0);
    glVertex2i (1, 1);
    glVertex2i (-1, 0);
    glVertex2i (-1, 1);
    glEnd ();

Answers:

• A quad

• A triangle

• Two lines

• A circle

• None of the above

65. On which matrix stack should gluOrtho2D be used?

Answers:

• Texture

• Color

• Modelview

• Projection

66. Which of the following buffer types is/are supported in OpenGL?

Answers:

• Stencil

• Color

• Depth

• Accumulation

• All of the above

67. What is the default parameter qualifier?

Answers:

• none

• in

• out

• inout

• None of the above

68. In Linux, what API will you use to get an OpenGL context?

Answers:

• agl

• wgl

• glX

• None of the above

69. What is the primary language of OpenGL?

Answers:

• C++

• C

• Ruby

• Perl

• Java

70. The matrix, after the following calls, will be the identity matrix.

    glLoadIdentity ();
    
    glTranslatef (0, 0, -10);
    glRotatef (40, 1, 0, 0);
    
    glTranslatef (0, 0, 10);
    glRotatef (-40, 1, 0, 0);

Answers:

• True

• False

71. Which of the following is not an OpenGL primitive?

Answers:

• Point

• Polygon

• Circle

• Quad

• Triangle

72. What will happen if a null pointer is used with glTexImage2D()? (In OpenGL >1.1)

Answers:

• An error will occur

• Undefined behaviour wil result

• The texture space will be allocated for future use with sub-textures

• None of the above

73. What is/are the return type/s of glGetx () ?

Answers:

• int

• It/they depend/s on the function

• void

• float

• vector

74. Is glFinish blocking?

Answers:

• Yes

• No

75. On which matrix stack should gluLookAt be used?

Answers:

• Texture

• Projection

• Modelview

• Color

76. OpenGL has some windows manipulation functions.

Answers:

• True

• False

77. Can you read a uniform value from the C code?

Answers:

• Yes

• No

78. Can "discard" be used in a vertex shader?

Answers:

• Yes

• No