
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































A 3D scene uses a perspective projection matrix with a field of view of 60 degrees, aspect ratio 16:9, near plane 0.1, and far plane 1000. If a point lies exactly on the near plane, what are its normalized device coordinates (NDC) z-value after perspective division? Assume OpenGL convention where NDC z ranges from -1 to 1. A. - B. 0 C. 1 D. It depends on the x and y coordinates CORRECT ANSWER A. - RATIONALE In OpenGL, the near plane maps to NDC z = -1 and the far plane to NDC z = 1. This is a standard property of the perspective projection matrix. The x and y coordinates do not affect the z mapping after perspective division because the z-component of the clip-space vector is divided by the w-component, which is -z_eye, and the mapping is linear in eye-space z. Thus, any point on the near plane will have NDC z = -1.
Consider a triangle rasterization algorithm that uses edge functions. For a pixel center at (x, y), the edge function for an edge from vertex A to vertex B is given by E(x,y) = (x - x_A)(y_B - y_A) - (y - y_A)(x_B - x_A). If the triangle vertices are in clockwise order, what is the condition for the pixel to be inside the triangle? A. All edge functions are positive B. All edge functions are negative C. All edge functions have the same sign (all positive or all negative) D. The sum of edge functions is positive CORRECT ANSWER C. All edge functions have the same sign (all positive or all negative) RATIONALE The edge function approach determines if a point is inside a triangle by checking the sign of the edge functions for each edge. For a consistently oriented triangle (either clockwise or counterclockwise), a point is inside if all edge functions have the same sign. The sign depends on the vertex order: for clockwise order, inside points yield negative edge functions (if using the standard formula), but the key is consistency. Option C correctly states that all must have the same sign, which is the general condition regardless of orientation. QUESTION 3 A 2D transformation matrix M is applied to a point P, resulting in P'. If M is a composition of a rotation by 45 degrees followed by a non-uniform scaling with factors (2, 1), what is the determinant of M? A. 1 B. 2
A Bézier curve is defined by four control points P0, P1, P2, P3. Which of the following properties is NOT true for a cubic Bézier curve? A. The curve passes through P0 and P3. B. The curve is tangent to the line segment P0P1 at P0. C. The curve always lies within the convex hull of the control points. D. The curve passes through P1 and P2. CORRECT ANSWER D. The curve passes through P1 and P2. RATIONALE A cubic Bézier curve interpolates its first and last control points (P and P3), so A is true. The tangent at P0 is along the vector from P0 to P1, so B is true. The curve lies within the convex hull of its control points, so C is true. However, the curve generally does not pass through the intermediate control points P1 and P2; they only influence the shape. Thus, D is false. QUESTION 6 In a z-buffer algorithm, what is the primary purpose of the depth test? A. To determine the color of a pixel based on lighting. B. To decide whether a fragment should be written to the framebuffer based on its depth. C. To perform perspective correction during rasterization. D. To clip fragments outside the view frustum. CORRECT ANSWER B. To decide whether a fragment should be written to the framebuffer based on its depth.
The depth test compares the depth of a fragment with the depth stored in the depth buffer. If the fragment is closer (or passes the depth function), it is written to the framebuffer and the depth buffer is updated. This is used for hidden surface removal. Option A is about shading, C is about interpolation, and D is about clipping, which are separate stages. QUESTION 7 Given a 4x4 transformation matrix that represents a rotation about an arbitrary axis, which of the following is true about its inverse? A. The inverse is equal to its transpose. B. The inverse is equal to the original matrix. C. The inverse is the negative of the original matrix. D. The inverse does not exist. CORRECT ANSWER A. The inverse is equal to its transpose. RATIONALE A rotation matrix is orthogonal, meaning its inverse equals its transpose. This holds for any rotation matrix, including those about arbitrary axes, as long as it is a pure rotation (no translation or scaling). The inverse is not generally equal to the original (except for 180-degree rotations), nor the negative, and it always exists. QUESTION 8 In the context of texture mapping, what does the term 'perspective-correct interpolation' refer to? A. Interpolating texture coordinates linearly in screen space. B. Interpolating attributes using barycentric coordinates without
Gouraud shading computes lighting at vertices and interpolates the resulting colors across the polygon. Phong shading interpolates vertex normals across the polygon and computes lighting per fragment (pixel). Thus, B is correct. Option A is reversed. Option C is false; Phong is more expensive. Option D is false; Phong produces more accurate specular highlights. QUESTION 10 A line is to be rasterized using Bresenham's algorithm from (0,0) to (5,3). What is the first pixel after (0,0) that is plotted? A. (1,0) B. (1,1) C. (2,1) D. (0,1) CORRECT ANSWER B. (1,1) RATIONALE Bresenham's algorithm for a line with slope 3/5 (0.6) starts at (0,0). The decision variable initially is 2dy - dx = 23 - 5 = 1. Since it's positive, the next pixel is (1,1) and the decision variable updates to 1 + 2(dy - dx) = 1 + 2(3-5) = -3. So the first step goes to (1,1). Thus, B is correct. QUESTION 11 In a 3D rendering pipeline, what is the purpose of the viewport transformation? A. To map normalized device coordinates to window coordinates. B. To transform world coordinates to camera coordinates. C. To project 3D points onto the 2D image plane.
D. To clip objects outside the view frustum. CORRECT ANSWER A. To map normalized device coordinates to window coordinates. RATIONALE The viewport transformation maps the normalized device coordinates (which are in the range [-1,1] for x and y) to the actual window or screen coordinates (pixel positions). Option B is the view transformation. Option C is the projection transformation. Option D is clipping. Thus, A is correct. QUESTION 12 Consider a scene with two overlapping triangles. Triangle A is at depth 0.5 and Triangle B is at depth 0.3. If the depth test function is set to GL_LESS, which triangle will be visible at the overlapping pixels? A. Triangle A B. Triangle B C. Both, depending on the order of rendering D. Neither, as the depth test will fail for both CORRECT ANSWER B. Triangle B RATIONALE The depth test GL_LESS means a fragment passes if its depth is less than the stored depth. Initially, the depth buffer is cleared to 1. (farthest). Triangle A at depth 0.5 passes (0.5 < 1.0) and writes depth 0.5. Triangle B at depth 0.3 passes (0.3 < 0.5) and overwrites, so Triangle B is visible. If rendered in reverse order, Triangle B writes 0.3, then Triangle A at 0.5 fails (0.5 < 0.3 is false). So Triangle B is always visible. Thus, B is correct.
The active edge table contains the edges that intersect the current scanline, sorted by their x-coordinate at that scanline. It is used to efficiently determine the spans to fill. Option A describes the edge table (ET). Option C is about shading. Option D is clipping. Thus, B is correct. QUESTION 15 A 3D object is transformed by a matrix that includes a translation, rotation, and scaling. If the object is to be transformed by another set of operations, what is the correct order of matrix multiplication to apply the new transformations after the existing ones? A. NewMatrix * OldMatrix B. OldMatrix * NewMatrix C. NewMatrix + OldMatrix D. OldMatrix - NewMatrix CORRECT ANSWER A. NewMatrix * OldMatrix RATIONALE In column-vector notation, transformations are applied by multiplying the matrix on the left of the vector. To apply new transformations after existing ones, the new transformation matrix is multiplied on the left: v' = NewMatrix * (OldMatrix * v) = (NewMatrix * OldMatrix) * v. Thus, the combined matrix is NewMatrix * OldMatrix. Option B would apply new transformations before old ones. Options C and D are not valid for combining transformations. QUESTION 16 Which of the following is a characteristic of a B-spline curve
compared to a Bézier curve? A. B-splines always interpolate their control points. B. B-splines have local control, meaning moving a control point affects only a portion of the curve. C. B-splines are always of degree equal to the number of control points minus one. D. B-splines cannot represent straight lines. CORRECT ANSWER B. B-splines have local control, meaning moving a control point affects only a portion of the curve. RATIONALE B-splines have local control: changing a control point only affects the curve in the vicinity of that control point, unlike Bézier curves where a control point affects the entire curve. Option A is false; B-splines generally do not interpolate their control points (except possibly at endpoints for clamped knots). Option C is false; the degree is independent of the number of control points. Option D is false; B- splines can represent straight lines. QUESTION 17 In the context of anti-aliasing, what does supersampling involve? A. Rendering the scene at a higher resolution and then downsampling. B. Using a post-processing filter to blur edges. C. Increasing the number of samples per pixel by jittering sample positions. D. Using a depth buffer to smooth edges. CORRECT ANSWER A. Rendering the scene at a higher resolution and then downsampling.
C. To apply textures to surfaces. D. To compute lighting equations. CORRECT ANSWER A. To convert vector graphics into a raster image by determining which pixels are covered by primitives. RATIONALE The rasterizer takes geometric primitives (like triangles) and determines which pixels (fragments) are covered by them, generating fragments for the fragment shader. Option B is the vertex processing stage. Option C is texture mapping, typically done in the fragment shader. Option D is lighting, also in the fragment shader. Thus, A is correct. QUESTION 20 Which of the following is true about the Phong reflection model? A. It accounts for ambient, diffuse, and specular reflection. B. It only models diffuse reflection. C. It requires ray tracing to compute. D. It does not consider the position of the light source. CORRECT ANSWER A. It accounts for ambient, diffuse, and specular reflection. RATIONALE The Phong reflection model combines ambient, diffuse, and specular components to approximate local illumination. Option B is false; it includes more than diffuse. Option C is false; it is a local illumination model used in rasterization. Option D is false; it uses the light position to compute the direction to the light. Thus, A is correct. QUESTION 21
In a rasterization pipeline, which of the following best describes the primary purpose of the viewport transformation? A. To map normalized device coordinates to window coordinates B. To convert world coordinates to camera coordinates C. To project 3D points onto the image plane D. To clip primitives against the view frustum CORRECT ANSWER A. To map normalized device coordinates to window coordinates RATIONALE The viewport transformation maps the normalized device coordinates (NDC), which are in the range [-1, 1] after perspective division, to the actual window or screen coordinates (pixel positions). Option B describes the view transformation, option C describes the projection transformation, and option D describes clipping, which occurs before the viewport transform. QUESTION 22 Consider a 2D transformation matrix M that scales by 2 in the x- direction and 3 in the y-direction, then rotates by 90 degrees counterclockwise. If a point P = (1, 1) is transformed by M, what is the resulting point? (Assume column vectors and that scaling is applied first, then rotation.) A. (-3, 2) B. (3, -2) C. (-2, 3) D. (2, -3) CORRECT ANSWER A. (-3, 2) RATIONALE
D. The edge equations are only used for anti-aliasing. CORRECT ANSWER A. The edge equations are used to determine if a pixel center is inside the triangle. RATIONALE Edge equations (or half-space tests) are used to test whether a pixel center lies inside the triangle. Depth interpolation is done separately using barycentric coordinates or plane equations. Normal interpolation is also separate. Edge equations are not solely for anti-aliasing; they are fundamental to inside-outside testing. QUESTION 25 Which of the following is a key advantage of using homogeneous coordinates in computer graphics transformations? A. They allow affine transformations to be represented as matrix multiplications. B. They reduce the dimensionality of the transformation matrix. C. They eliminate the need for perspective division. D. They simplify the representation of rotations. CORRECT ANSWER A. They allow affine transformations to be represented as matrix multiplications. RATIONALE Homogeneous coordinates allow translation (and other affine transformations) to be represented as matrix multiplications, enabling composition of transformations. They do not reduce dimensionality (they increase it), perspective division is still required for projection, and rotations are not simplified by homogeneous coordinates per se. QUESTION 26
In a z-buffer algorithm, what is the purpose of the depth buffer? A. To store the color of each pixel. B. To store the depth value of the closest object at each pixel. C. To store the normal vector for shading. D. To store the stencil value for masking. CORRECT ANSWER B. To store the depth value of the closest object at each pixel. RATIONALE The depth buffer (z-buffer) stores the depth (distance from the camera) of the closest fragment at each pixel, used to resolve visibility. The color buffer stores colors, the normal buffer (if present) stores normals, and the stencil buffer stores stencil values. QUESTION 27 Which of the following transformations is NOT an affine transformation? A. Translation B. Rotation C. Perspective projection D. Shear CORRECT ANSWER C. Perspective projection RATIONALE Perspective projection is a projective transformation, not affine, because it does not preserve parallelism and requires division by w. Translation, rotation, and shear are affine transformations (they preserve parallelism and can be represented by a 3x3 matrix with last row [0,0,1] in 2D homogeneous coordinates).
First translate: (2+1, 3-1, 4+2) = (3,2,6). Then rotate about z by 90° CCW: (x,y) -> (-y, x). So (3,2) -> (-2,3). Thus final point is (-2,3,6). Option B is rotation clockwise, option C is incorrect rotation, option D is another error. QUESTION 30 In Gouraud shading, how is the color at a pixel determined? A. By interpolating vertex normals and applying the lighting model per pixel. B. By interpolating vertex colors across the triangle. C. By evaluating the lighting model at the pixel using the interpolated normal. D. By using a precomputed texture map. CORRECT ANSWER B. By interpolating vertex colors across the triangle. RATIONALE Gouraud shading computes lighting at each vertex and then interpolates the resulting colors across the triangle. Option A describes Phong shading (interpolating normals then lighting per pixel). Option C is essentially Phong shading. Option D is texture mapping. QUESTION 31 Which of the following is true about the clipping stage in the graphics pipeline? A. Clipping removes primitives that are outside the view frustum. B. Clipping is performed after the viewport transformation. C. Clipping is only necessary for 2D graphics.
D. Clipping increases the number of primitives to be rasterized. CORRECT ANSWER A. Clipping removes primitives that are outside the view frustum. RATIONALE Clipping removes parts of primitives that lie outside the view frustum (or clip volume) to avoid rasterizing invisible geometry. It occurs before the viewport transformation (in clip space or normalized device coordinates). It is essential for 3D graphics as well, and it reduces, not increases, primitives. QUESTION 32 In a 2D transformation, what does the matrix [[0, -1], [1, 0]] represent? A. A rotation by 90 degrees clockwise B. A rotation by 90 degrees counterclockwise C. A reflection across the line y = x D. A scaling by -1 in both directions CORRECT ANSWER B. A rotation by 90 degrees counterclockwise RATIONALE The matrix [[cos;‚ ×6–ã¸], [sin;‚ 6÷3¸]] for ;ƒÓ“ v—`es [[0, -1], [1, 0]], which rotates points 90° counterclockwise. For clockwise, it would be [[0, 1], [-1, 0]]. Reflection across y=x is [[0,1],[1,0]]. Scaling by -1 in both directions is [[-1,0],[0,-1]]. QUESTION 33 Which of the following best describes the painter's algorithm? A. It renders polygons in order of decreasing depth, from farthest to nearest.