BIT304 · TU past paper
Computer Graphics 2081 question paper
The complete TU 2081 exam paper for Computer Graphics (BIT304), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- 1Z-buffer method and limitationsHideAnswer
Z-Buffer Method for Visible Surface Detection
The Z-Buffer (Depth Buffer) method is an image-space visible surface detection algorithm that determines which surface is closest to the viewer at each pixel position on the projection plane. It maintains two buffers: - Frame Buffer: sto...
- 210 marksNumericalLine clipping concepts and roleHideAnswer
What is the role of clipping? Plot the line with end points (20, 10) and (30, 18) using DDA.[10]
Model Answer: Clipping and DDA Line Drawing
Part 1: Role of Clipping
Clipping is the process of identifying and retaining only those portions of a picture (points, lines, polygons, text, curves) that lie inside a specified region called the clipping window (or viewport), while discarding the portions that fall outside it.
Roles / Importance of Clipping:
-
Visibility determination: It decides which parts of an object are visible within the viewing window and which parts must be removed.
-
Computational efficiency: By eliminating objects or portions of objects lying outside the display region, less data is passed to the rendering pipeline, improving speed.
-
Preventing overflow/artifacts: It stops drawing outside valid display boundaries, avoiding wrap-around, garbage pixels, and memory errors.
-
Zooming and panning support: Correct clipping is essential when a scene is scaled or scrolled so only the relevant window contents appear.
-
Applications: Extracting part of a scene for viewing, drawing operations (erase, copy, move), displaying multi-window environments, solid modeling, and anti-aliasing at edges.
Common clipping algorithms include Cohen-Sutherland and Liang-Barsky (line clipping) and Sutherland-Hodgman (polygon clipping).
Part 2: DDA Line Drawing
DDA (Digital Differential Analyzer) is an incremental scan-conversion line algorithm that computes successive pixel positions using floating-point increments.
Given Data
- $(x_0, y_0) = (20, 10)$
- $(x_1, y_1) = (30, 18)$
Step 1: Compute differences
$$\Delta x = x_1 - x_0 = 30 - 20 = 10$$ $$\Delta y = y_1 - y_0 = 18 - 10 = 8$$
Step 2: Determine number of steps
$$\text{steps} = \max(|\Delta x|, |\Delta y|) = \max(10, 8) = 10$$
Step 3: Compute increments
$$x_{inc} = \frac{\Delta x}{\text{steps}} = \frac{10}{10} = 1.0$$ $$y_{inc} = \frac{\Delta y}{\text{steps}} = \frac{8}{10} = 0.8$$
Step 4: Generate points
Starting at $(20, 10)$, add increments each step and round to nearest integer.
Step x (exact) y (exact) Plotted (round) 0 20.0 10.0 (20, 10) 1 21.0 10.8 (21, 11) 2 22.0 11.6 (22, 12) 3 23.0 12.4 (23, 12) 4 24.0 13.2 (24, 13) 5 25.0 14.0 (25, 14) 6 26.0 14.8 (26, 15) 7 27.0 15.6 (27, 16) 8 28.0 16.4 (28, 16) 9 29.0 17.2 (29, 17) 10 30.0 18.0 (30, 18) (Note: rounding uses standard round-half-up; e.g. 12.4 → 12, 15.6 → 16.)
Plot
y 18 | * 17 | * 16 | * * 15 | * 14 | * 13 | * 12 | * * 11 |* 10 * +----+----+----+----+----+----+----+----+----+----+---> x 20 21 22 23 24 25 26 27 28 29 30The plotted pixels approximate a straight line from $(20, 10)$ to $(30, 18)$.
-
- 310 marksNumericalRotation transformation and matricesHideAnswer
List the rotation matrix in clockwise direction with respect to x-axis, y-axis and z-axis. Rotate the object (0, 0, 0), (2, 3, 0), (5, 4, 0) about the rotation axis y = 4.[10]
Rotation Matrices and Rotation About the Line y = 4
STEP 1 - EXTRACT (Given data)
Object vertices (2D points in xy-plane, z = 0):
- $P_1 = (0, 0, 0)$
- $P_2 = (2, 3, 0)$
- $P_3 = (5, 4, 0)$
Rotation axis: the line $y = 4$
Rotation angle: NOT specified in the question.
Note on missing data: The angle of rotation is not given. Since the points all lie in the $xy$-plane ($z = 0$) and the axis $y = 4$ is a line in that plane, this is a 2D rotation problem about a fixed point/line in the plane. The standard convention when no angle is stated in TU exams is a $180^\circ$ rotation (which keeps the figure in the same plane), but $90^\circ$ is also used. I will solve for $180^\circ$ about the line $y = 4$ (the most natural in-plane interpretation), and also show the general method.
STEP 2 - SOLVE
Part 1: Clockwise Rotation Matrices
A clockwise rotation by angle $\theta$ is the same as a counter-clockwise rotation by $-\theta$. Using $\cos(-\theta) = \cos\theta$ and $\sin(-\theta) = -\sin\theta$:
About X-axis: $$ R_x(\theta) = \begin{bmatrix} 1 & 0 & 0 \ 0 & \cos\theta & \sin\theta \ 0 & -\sin\theta & \cos\theta \end{bmatrix} $$
About Y-axis: $$ R_y(\theta) = \begin{bmatrix} \cos\theta & 0 & -\sin\theta \ 0 & 1 & 0 \ \sin\theta & 0 & \cos\theta \end{bmatrix} $$
About Z-axis (the relevant one for in-plane 2D rotation): $$ R_z(\theta) = \begin{bmatrix} \cos\theta & \sin\theta & 0 \ -\sin\theta & \cos\theta & 0 \ 0 & 0 & 1 \end{bmatrix} $$
Part 2: Rotating the object about the line y = 4
Since all points lie in the $z = 0$ plane and $y = 4$ is a horizontal line in that plane, the rotation is a 2D rotation about the pivot on that line, performed using $R_z$.
Sequence: Translate axis to origin, rotate about $z$, translate back.
$$T_1: (x, y) \to (x, y - 4), \qquad T_2: (x, y) \to (x, y + 4)$$
Step 1 - Translate by $(0, -4)$:
- $P_1' = (0, -4)$
- $P_2' = (2, -1)$
- $P_3' = (5, 0)$
Step 2 - Rotate by $\theta = 180^\circ$ (clockwise = same as CCW for $180^\circ$): With $\cos 180^\circ = -1$, $\sin 180^\circ = 0$: $$ R_z(180^\circ) = \begin{bmatrix} -1 & 0 \ 0 & -1 \end{bmatrix}, \quad (x, y) \to (-x, -y) $$
- $P_1'' = (0, 4)$
- $P_2'' = (-2, 1)$
- $P_3'' = (-5, 0)$
Step 3 - Translate back by $(0, +4)$:
- $P_1''' = (0, 8, 0)$
- $P_2''' = (-2, 5, 0)$
- $P_3''' = (-5, 4, 0)$
Final Rotated Points ($180^\circ$ about y = 4):
Original Rotated $(0, 0, 0)$ $(0, 8, 0)$ $(2, 3, 0)$ $(-2, 5, 0)$ $(5, 4, 0)$ $(-5, 4, 0)$
Why the In-Plane Reading Is Used
Interpreting $y = 4$ as an axis parallel to the x-axis and applying a 3D $90^\circ$ rotation about the y-axis ($R_y$) sends the points out of the plane, which is inconsistent because:
- A line $y = 4$ in a 2D figure is a pivot for an in-plane rotation about the z-axis, not the y-axis.
- The arithmetic also mislabels: rotating a point about the line $y=4$ should not change the $y$-coordinate of a point already at $y=4$ into $(0,4,5)$ moving in $z$; a physical rotation about a line in the plane keeps points in the plane for $180^\circ$.
Because the angle is not given, the numeric result is not unique. The working above uses $180^\circ$, the standard in-plane default; an out-of-plane $90^\circ$ rotation about the y axis would give different final coordinates.
- 45 marksPhong shading algorithm and procedureHideAnswer
Write procedure to render the polygon surface by using Phong shading model. [5]
Phong shading is an interpolation-based shading technique that calculates surface color at each pixel by interpolating normal vectors across the polygon surface and applying the Phong illumination model at each point. - Compute the surfa...
- 55 marksParametric cubic curvesHideAnswer
Explain about parametric cubic curve with its properties. [5]
A parametric cubic curve is a curve defined by cubic polynomial equations in parametric form: x(t) = a₀ + a₁t + a₂t² + a₃t³ y(t) = b₀ + b₁t + b₂t² + b₃t³ where t is a parameter (typically t ∈ [0,1]), and a₀, a₁, a₂, a₃, b₀, b₁, b₂, b₃ ar...
- 65 marksNumericalMidpoint circle drawing algorithmHideAnswer
Digitize circle with center (0, 0) and radius = 6. [5]
- Center: $(xc, yc) = (0, 0)$ - Radius: $r = 6$ - Start point: $(x, y) = (0, r) = (0, 6)$ - Initial decision parameter: $p0 = 1 - r = 1 - 6 = -5$ We compute points in the second octant ($x$ from 0 up to $x = y$), then apply 8-way symmetr...
- 75 marksPolygon table and error-free generationHideAnswer
Explain the use of polygon tables for boundary representations. [5]
Polygon tables are data structures used in computer graphics to store and represent the geometric and topological information of 3D objects using polygonal surfaces (typically triangles or quadrilaterals). They form the foundation of bou...
- 85 marksRaster scan display systemsHideAnswer
Differentiate between raster scan and random scan display systems. [5]
Aspect Raster Scan Random Scan --------------------------------- Scanning Method Electron beam sweeps across the screen in a systematic pattern (left to right, top to bottom) Electron beam moves directly to specific points on the screen ...
- 95 marksIntensity attenuationHideAnswer
What is intensity attenuation? Describe the various types of projection. [5]
Intensity attenuation refers to the reduction or weakening of light intensity as it travels through a medium or interacts with surfaces. In computer graphics and rendering contexts, this occurs due to: - Distance effects: Light intensity...
- 105 marksOpenGL and callback functionsHideAnswer
Explain about openGL and call back functions. [5]
OpenGL (Open Graphics Library) is a cross-platform, open-source graphics API (Application Programming Interface) that enables developers to create 2D and 3D graphics applications. It provides a set of functions to render graphics on vari...
- 115 marks3D object representations and storageHideAnswer
How the geometric and attribute information of a 3D objects are stored for the object representations? Explain with suitable example. [5]
3D objects are represented in computer graphics by storing two fundamental types of information: 1. Geometric Information - shape and spatial structure 2. Attribute Information - visual and material properties --- Geometric data defines ...
- 125 marksAmbient light and ambient reflectionHideAnswer
Write short notes on: a) Ambient light b) Diffuse reflection [5]
Short Notes: Ambient Light and Diffuse Reflection
a) Ambient Light
Definition: Ambient light is the general, non-directional illumination present in a scene that comes from all directions uniformly. It represents indirect light that has been scattered and reflected multiple times throughout the environment.
Characteristics:
- Has no specific source or direction
- Provides uniform illumination to all surfaces regardless of their orientation
- Prevents completely dark areas in a scene (shadows are not pitch black)
- Typically modeled as a constant intensity value in rendering equations
Role in Rendering: In computer graphics, ambient light is often included in the illumination model to ensure all surfaces receive some minimum level of brightness. Without ambient light, surfaces facing away from light sources would appear completely black, which is unrealistic.
Formula representation: I_ambient = K_a × I_a
where K_a is the ambient reflection coefficient and I_a is the ambient light intensity.
b) Diffuse Reflection
Definition: Diffuse reflection occurs when light strikes a rough or matte surface and is scattered uniformly in all directions. The reflected light intensity depends on the angle between the surface normal and the incident light direction.
Characteristics:
- Occurs on rough, non-shiny surfaces (paper, cloth, matte paint)
- Follows Lambert's Cosine Law: reflected intensity is proportional to the cosine of the angle between the surface normal and light direction
- Independent of viewer position (appears same from all viewing angles)
- Produces no specular highlights
Lambert's Law: I_diffuse = K_d × I_light × cos(θ)
where:
- K_d = diffuse reflection coefficient (0 to 1)
- I_light = incident light intensity
- θ = angle between surface normal and light direction
Physical Basis: The cosine relationship arises because light energy is distributed over a larger surface area as the angle increases, reducing intensity per unit area.