Skip to main content

Computer Graphics MCQs with Answers

Practice important Computer Graphics MCQs with answers and explanations.

Chapter: 41
Q1361:
In the code example, what is the purpose of the 'glViewport()' function?
A. Defining the window size
B. Setting the light source position
C. Scaling the objects
D. Moving the camera
Correct Answer: A
Chapter: 41
Q1362:
The 'gluLookAt()' function in OpenGL defines which aspect of the camera?
A. The position, orientation, and up-vector
B. Camera zoom level
C. Projection depth
D. Viewport size
Correct Answer: A
Chapter: 41
Q1363:
Which operation ensures that objects outside the viewable volume are not drawn?
A. Clipping
B. Scaling
C. Translation
D. Rotation
Correct Answer: A
Chapter: 41
Q1364:
When drawing a scene, the z-values of the vertices are used for which purpose?
A. To calculate depth and visibility
B. To scale objects
C. To translate objects
D. To rotate objects
Correct Answer: A
Chapter: 41
Q1365:
Which function in OpenGL is used to create a wireframe cube?
A. glutWireCube()
B. glScalef()
C. glLoadIdentity()
D. gluLookAt()
Correct Answer: A
Chapter: 41
Q1366:
What is the default position and orientation of the camera in OpenGL if 'gluLookAt()' is not used?
A. The camera is at the origin, pointing along the negative z-axis
B. The camera is at the top-right corner
C. The camera is at the origin, pointing along the positive y-axis
D. The camera is at the top-left corner
Correct Answer: A
Chapter: 41
Q1367:
What does the 'glutMainLoop()' function do in the OpenGL program?
A. It initializes the display
B. It sets the camera position
C. It starts the rendering loop
D. It defines the object's properties
Correct Answer: C
Chapter: 41
Q1368:
Fill in the blank: The function used to initialize the OpenGL program is ___________.
A. glClearColor
B. gluLookAt
C. glutInit
D. glScalef()
Correct Answer: C
Chapter: 41
Q1369:
Fill in the blank: The OpenGL function ___________ is used to clear the window before drawing the scene.
A. glClear
B. glLoadIdentity
C. gluLookAt
D. glScalef()
Correct Answer: A
Chapter: 41
Q1370:
Fill in the blank: To apply a viewing transformation in OpenGL, the function ___________ is used.
A. gluLookAt
B. glLoadIdentity
C. gluPerspective
D. glFrustum()
Correct Answer: A
Chapter: 41
Q1371:
Fill in the blank: The ___________ function is used to define the camera's projection in OpenGL.
A. glFrustum
B. glLoadIdentity
C. gluLookAt
D. glTranslatef()
Correct Answer: A
Chapter: 41
Q1372:
What is the main purpose of using the glFrustum() function in OpenGL?
A. Define a perspective projection matrix
B. Set the field of view
C. Apply a translation matrix
D. Set the near and far planes
Correct Answer: A
Chapter: 41
Q1373:
What does the gluPerspective() function do in OpenGL?
A. Defines a perspective projection matrix
B. Defines a modelview matrix
C. Defines the near and far planes
D. Sets the camera position
Correct Answer: A
Chapter: 41
Q1374:
The order of transformations in OpenGL is important because:
A. They are always applied in the same order
B. Transformation order affects the final result
C. They don't affect the result
D. They must always be applied in reverse
Correct Answer: B
Chapter: 41
Q1375:
Which of the following transformations does glTranslate*() perform in OpenGL?
A. Scaling the object
B. Moving the object along the x, y, and z axes
C. Rotating the object
D. Reflecting the object
Correct Answer: B
Chapter: 41
Q1376:
In the following OpenGL code, what is the effect of glTranslatef(0.0, 0.0, 0.0)?
A. Reflects the object
B. No effect on the object
C. Rotates the object
D. Translates the object to the origin
Correct Answer: B
Chapter: 41
Q1377:
Which OpenGL function rotates an object around the x, y, and z axes?
A. glRotatef()
B. glTranslatef()
C. glScalef()
D. glLoadIdentity()
Correct Answer: A
Chapter: 41
Q1378:
What does the glScale*() function in OpenGL do?
A. It reflects an object across axes
B. It stretches or shrinks an object
C. It moves an object
D. It rotates an object
Correct Answer: B
Chapter: 41
Q1379:
The effect of a scale factor of -1.0 on an object in OpenGL is:
A. Shrinking the object
B. Stretching the object
C. Reflecting the object across an axis
D. Rotating the object
Correct Answer: C
Chapter: 41
Q1380:
What is the primary purpose of the modelview matrix in OpenGL?
A. To define the color of an object
B. To combine transformations for modeling and viewing
C. To handle texture mapping
D. To set the lighting for the scene
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Computer Graphics

🚀 Start Quiz Now