Computer Graphics MCQs with Answers
Practice important Computer Graphics MCQs with answers and explanations.
Chapter: 43
Q1481:
In the provided code, which material property is set by glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);?
A. Diffuse reflection
B. Specular reflection
C. Ambient reflection
D. Emission
Correct Answer:
A
Chapter: 43
Q1482:
What is the purpose of the glPushMatrix() function in OpenGL?
A. Saves the current transformation matrix
B. Translates the object
C. Sets the light source position
D. Pops the transformation matrix
Correct Answer:
A
Chapter: 43
Q1483:
The function glColorMaterial(GL_FRONT, GL_DIFFUSE) changes which material property?
A. Diffuse reflection
B. Specular reflection
C. Ambient reflection
D. Shininess
Correct Answer:
A
Chapter: 43
Q1484:
In OpenGL, what does glEnable(GL_COLOR_MATERIAL) do?
A. Enables color tracking for material properties
B. Enables lighting
C. Initializes objects for rendering
D. Applies texture to objects
Correct Answer:
A
Chapter: 43
Q1485:
Which of the following commands sets up the light source in OpenGL?
A. glLightfv(GL_LIGHT0, GL_POSITION, light_position)
B. glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse)
C. glColor3f(0.2, 0.5, 0.8)
D. glTranslatef(1.25, 3.0, 0.0)
Correct Answer:
A
Chapter: 43
Q1486:
What does glutSolidSphere(1.0, 16, 16); do in OpenGL?
A. Draws a solid sphere
B. Translates an object
C. Sets the light position
D. Enables smooth shading
Correct Answer:
A
Chapter: 43
Q1487:
The function glEnable(GL_LIGHTING) enables what in OpenGL?
A. Lighting in the scene
B. Depth testing
C. Texture mapping
D. Transformation matrix
Correct Answer:
A
Chapter: 43
Q1488:
Which material property is modified by glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);?
A. Specular reflection
B. Diffuse reflection
C. Ambient reflection
D. Emission
Correct Answer:
A
Chapter: 43
Q1489:
In the provided OpenGL code, what is the purpose of glTranslatef(-1.25, 3.0, 0.0);?
A. Translates the object to a new position
B. Sets the light source position
C. Scales the object
D. Rotates the object
Correct Answer:
A
Chapter: 43
Q1490:
What is the role of glutMainLoop() in OpenGL?
A. Starts the rendering loop
B. Initializes the window
C. Defines the light source
D. Changes the color of the object
Correct Answer:
A
Chapter: 43
Q1491:
Which parameter is used to specify the light position in OpenGL?
A. GL_POSITION
B. GL_DIFFUSE
C. GL_SPECULAR
D. GL_AMBIENT
Correct Answer:
A
Chapter: 43
Q1492:
The function glDisable(GL_COLOR_MATERIAL) does what in OpenGL?
A. Disables color tracking for material properties
B. Disables lighting
C. Disables depth testing
D. Disables texture mapping
Correct Answer:
A
Chapter: 43
Q1493:
In the provided example, which OpenGL function sets the shininess of the material?
A. glMaterialf(GL_FRONT, GL_SHININESS, low_shininess)
B. glLightfv(GL_LIGHT0, GL_POSITION, light_position)
C. glEnable(GL_COLOR_MATERIAL)
D. glColor3f(0.9, 0.0, 0.2)
Correct Answer:
A
Chapter: 43
Q1494:
Which OpenGL function is used to change the current color of an object?
A. glColor3f(0.2, 0.5, 0.8)
B. glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse)
C. glEnable(GL_LIGHTING)
D. glTranslatef(1.25, 3.0, 0.0)
Correct Answer:
A
Chapter: 43
Q1495:
What is the purpose of glutReshapeFunc(reshape); in OpenGL?
A. Handles window resizing
B. Initializes lighting settings
C. Sets the camera position
D. Enables texture mapping
Correct Answer:
A
Chapter: 43
Q1496:
The function glutMouseFunc(mouse); in OpenGL is used to handle what?
A. Mouse button presses
B. Window resizing
C. Object transformations
D. Light changes
Correct Answer:
A
Chapter: 43
Q1497:
Which OpenGL function is used to load the projection matrix for setting the viewport?
A. glMatrixMode(GL_PROJECTION)
B. glShadeModel(GL_SMOOTH)
C. glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse)
D. glEnable(GL_DEPTH_TEST)
Correct Answer:
A
Chapter: 43
Q1498:
In OpenGL, which of the following functions is used to set the diffuse reflection for the front face of an object?
A. glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse)
B. glLightfv(GL_LIGHT0, GL_POSITION, light_position)
C. glTranslatef(1.25, 3.0, 0.0)
D. glColorMaterial(GL_FRONT, GL_DIFFUSE)
Correct Answer:
A
Chapter: 43
Q1499:
Fill in the blank: The function glMaterialfv() is used to set the ________ in OpenGL.
A. Material properties
B. Texture properties
C. Lighting parameters
D. Projection matrix
Correct Answer:
A
Chapter: 43
Q1500:
The glutMouseFunc(mouse) function is used to handle ________.
A. Mouse events
B. Keyboard events
C. Object transformations
D. Window events
Correct Answer:
A