OpenGL OpenGL Transformations and Matrices 1 — Questions and Answers
Question 1: Which matrix transforms vertices from world space into camera (eye) space?
- Model matrix
- Projection matrix
- View matrix (Correct answer)
- Normal matrix
Correct answer: View matrix
The view matrix represents the camera's position and orientation, transforming world-space positions into eye space.
Question 2: What is the purpose of a projection matrix in the OpenGL pipeline?
- Converts object space to world space
- Maps eye-space coordinates to clip space, defining the view frustum (Correct answer)
- Converts clip space to NDC
- Applies lighting calculations
Correct answer: Maps eye-space coordinates to clip space, defining the view frustum
The projection matrix encodes perspective or orthographic projection, mapping the view frustum to the canonical clip volume.
Question 3: In OpenGL, what coordinate system results after dividing clip coordinates by the w component?
- World space
- Eye space
- Normalized Device Coordinates (NDC) (Correct answer)
- Window space
Correct answer: Normalized Device Coordinates (NDC)
The perspective divide (dividing x, y, z by w) converts clip coordinates to NDC, which range from -1 to +1 on each axis.
Question 4: Which transformation is used to move an object to a specific position in world space?
- Rotation
- Scale
- Translation (Correct answer)
- Shear
Correct answer: Translation
Translation shifts the origin of an object by adding an offset to its coordinates, repositioning it in world space.
Question 5: In OpenGL, matrices are stored in which memory order?
- Row-major order
- Column-major order (Correct answer)
- Diagonal order
- Interleaved order
Correct answer: Column-major order
OpenGL uses column-major storage, so the first four floats of a mat4 represent the first column, not the first row.
Question 6: What is the Model-View-Projection (MVP) matrix used for in OpenGL rendering?
- Transforms a vertex from object space all the way to clip space in one multiplication (Correct answer)
- Applies lighting in eye space
- Converts texture coordinates
- Defines the depth buffer range
Correct answer: Transforms a vertex from object space all the way to clip space in one multiplication
Multiplying the model, view, and projection matrices into a single MVP matrix lets the vertex shader transform all vertices in one operation.
Which matrix transforms vertices from world space into camera (eye) space?