Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Explain parallel and perspective projections in 3D graphics. Derive the transformation matrix for perspective projection.

Parallel and Perspective Projections in 3D Graphics

Projection transforms 3D points onto a 2D projection plane (view plane) by passing projectors (lines from object points toward the plane).

Parallel Projection

Projectors are parallel to each other (the centre of projection is at infinity).

  • Preserves relative proportions and parallelism of lines; good for engineering/technical drawings.
  • Does not give a realistic view (no foreshortening).
  • Types: Orthographic (projectors perpendicular to the plane) and Oblique (projectors at an angle).

For orthographic projection onto the z=0z=0 plane, xp=x,  yp=y,  zp=0x_p=x,\; y_p=y,\; z_p=0, with matrix:

Portho=[1000010000000001]P_{ortho}=\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&0\\0&0&0&1\end{bmatrix}

Perspective Projection

Projectors all pass through a single centre of projection (COP). Objects farther from the COP appear smaller (perspective foreshortening), giving a realistic view, but parallel lines converge to vanishing points and true dimensions are not preserved.

Derivation of the Perspective Projection Matrix

Let the centre of projection be at the origin and the projection plane at z=dz=d (along the zz-axis). Consider a 3D point P(x,y,z)P(x,y,z) projected to P(xp,yp,d)P'(x_p,y_p,d) on the plane.

Using similar triangles along the zz-axis:

xpx=dzxp=xdz=xz/d\frac{x_p}{x}=\frac{d}{z}\quad\Rightarrow\quad x_p=\frac{x\,d}{z}=\frac{x}{z/d} ypy=dzyp=ydz=yz/d\frac{y_p}{y}=\frac{d}{z}\quad\Rightarrow\quad y_p=\frac{y\,d}{z}=\frac{y}{z/d}

In homogeneous coordinates, represent P=[x  y  z  1]TP=[x\;y\;z\;1]^T. The perspective matrix is:

Pper=[100001000010001d0]P_{per}=\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&\tfrac{1}{d}&0\end{bmatrix}

Multiplying:

Pper[xyz1]=[xyzz/d]P_{per}\cdot\begin{bmatrix}x\\y\\z\\1\end{bmatrix}=\begin{bmatrix}x\\y\\z\\z/d\end{bmatrix}

Dividing by the homogeneous coordinate h=z/dh=z/d gives the Cartesian point:

xp=xz/d,yp=yz/d,zp=zz/d=dx_p=\frac{x}{z/d},\qquad y_p=\frac{y}{z/d},\qquad z_p=\frac{z}{z/d}=d

which matches the similar-triangle result. The term 1/d1/d in the bottom row produces the perspective division that creates foreshortening.

3dprojection
2long10 marks

Explain the Z-buffer (depth buffer) algorithm for hidden surface removal with its advantages and limitations.

Z-Buffer (Depth Buffer) Algorithm

The Z-buffer algorithm is an image-space method for hidden surface removal. It uses two buffers of the same resolution as the display:

  • Frame buffer – stores the colour/intensity of each pixel.
  • Depth (Z) buffer – stores the depth (zz value) of the closest surface seen so far at each pixel.

Algorithm

1. Initialize:
   for each pixel (x, y):
       depthBuffer[x][y] = z_max   // farthest depth (background)
       frameBuffer[x][y] = background_colour

2. For each polygon in the scene:
     For each pixel (x, y) covered by the polygon:
         Compute depth z of the polygon at (x, y)
         if z < depthBuffer[x][y]:        // nearer to viewer
             depthBuffer[x][y] = z
             frameBuffer[x][y] = surface_colour at (x, y)

The depth at successive pixels along a scan line is found incrementally. If Ax+By+Cz+D=0Ax+By+Cz+D=0 is the plane equation, then moving one pixel in xx:

z=zACz' = z - \frac{A}{C}

so only an addition is needed per pixel.

Advantages

  • Simple to implement (in hardware too); used in modern GPUs.
  • Handles any number of polygons; no presorting of objects is required.
  • Easy to handle intersecting and complex surfaces; processing time is roughly independent of scene complexity for a fixed resolution.

Limitations

  • Requires large memory for the depth buffer.
  • Spends time computing pixels that may later be overwritten (no early sorting); can be inefficient.
  • Limited depth precision can cause z-fighting (aliasing of nearly coplanar surfaces).
  • Cannot directly handle transparency and anti-aliasing without extensions.
  • Resolution-dependent (image-space), so it does not produce an analytic/object-space description.
hidden-surface
3long10 marks

Explain the scan-line polygon fill algorithm and the boundary fill algorithm with examples.

Scan-Line Polygon Fill Algorithm

This is an image-space area-filling method that fills a polygon scan line by scan line, using the odd-even (parity) rule.

Steps

  1. Find yminy_{min} and ymaxy_{max} of the polygon.
  2. For each scan line yy from yminy_{min} to ymaxy_{max}:
    • Find the intersection points of the scan line with all polygon edges.
    • Sort the intersection xx-coordinates in increasing order.
    • Pair them: (x1,x2),(x3,x4),(x_1,x_2),(x_3,x_4),\dots and fill the pixels between each pair (inside the polygon by the odd-even rule).
  3. Handle special cases:
    • Vertices: count a vertex once if it is a local min/max, otherwise twice, so parity stays correct.
    • Use an Edge Table (ET) and Active Edge Table (AET) with coherence: as yy increases by 1, update each intersection xx by 1/m1/m (the inverse slope) instead of recomputing.

Example: For a triangle with vertices (2,2),(8,2),(5,8)(2,2),(8,2),(5,8), the scan line y=4y=4 intersects the two sloping edges at, say, x=3x=3 and x=7x=7; pixels from x=3x=3 to x=7x=7 on that line are filled. Repeating for every scan line fills the triangle.

Boundary Fill Algorithm

This is a seed-fill (object-space, recursive) method. Given an interior seed point, it fills outward until the polygon boundary colour is reached.

boundaryFill(x, y, fillColour, boundaryColour):
    current = getPixel(x, y)
    if current != boundaryColour and current != fillColour:
        setPixel(x, y, fillColour)
        boundaryFill(x+1, y, fillColour, boundaryColour)
        boundaryFill(x-1, y, fillColour, boundaryColour)
        boundaryFill(x, y+1, fillColour, boundaryColour)
        boundaryFill(x, y-1, fillColour, boundaryColour)   // 4-connected
  • 4-connected fill checks up/down/left/right; 8-connected also checks the four diagonals (needed for shapes with thin diagonal boundaries).

Example: A circle drawn in red (boundary colour) with a seed pixel at its centre is filled blue; recursion stops at the red ring.

Comparison

  • Scan-line fill needs the polygon's edge list and works well for solid polygons; boundary fill needs only a seed point and a known boundary colour but can be memory/stack-heavy and is suited to interactive/region filling.
polygon-fill
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Explain the concept of window to viewport transformation.

Window-to-Viewport Transformation

A window is the rectangular region selected in world coordinates that is to be displayed. A viewport is the rectangular region on the device/screen where the window's contents are mapped. Window-to-viewport transformation (viewing transformation) maps each point in the window to a corresponding point in the viewport while preserving relative position.

Let a window point be (xw,yw)(x_w, y_w) with window limits (xwmin,xwmax,ywmin,ywmax)(xw_{min}, xw_{max}, yw_{min}, yw_{max}) and the viewport limits (xvmin,xvmax,yvmin,yvmax)(xv_{min}, xv_{max}, yv_{min}, yv_{max}). The mapped point (xv,yv)(x_v, y_v) is found by keeping the relative position equal:

xvxvminxvmaxxvmin=xwxwminxwmaxxwmin\frac{x_v - xv_{min}}{xv_{max}-xv_{min}} = \frac{x_w - xw_{min}}{xw_{max}-xw_{min}} xv=xvmin+(xwxwmin)sx,yv=yvmin+(ywywmin)syx_v = xv_{min} + (x_w - xw_{min})\,s_x,\qquad y_v = yv_{min} + (y_w - yw_{min})\,s_y

where the scaling factors are

sx=xvmaxxvminxwmaxxwmin,sy=yvmaxyvminywmaxywmin.s_x = \frac{xv_{max}-xv_{min}}{xw_{max}-xw_{min}},\qquad s_y = \frac{yv_{max}-yv_{min}}{yw_{max}-yw_{min}}.

If sxsys_x \ne s_y, the displayed image is distorted (stretched); equal factors preserve the aspect ratio. The process is equivalent to: translate window to origin, scale by (sx,sy)(s_x,s_y), then translate to the viewport position.

windowing
5short5 marks

Differentiate between parallel projection and perspective projection.

Parallel vs Perspective Projection

AspectParallel ProjectionPerspective Projection
Centre of projectionAt infinityAt a finite point (COP)
ProjectorsParallel to each otherConverge at the COP
Size of objectIndependent of distance (no foreshortening)Decreases with distance (foreshortening)
RealismLess realisticMore realistic (how the eye sees)
Parallel linesRemain parallelConverge to vanishing points
DimensionsTrue measurements preservedNot preserved
UseEngineering/CAD drawingsGames, walkthroughs, realistic scenes
TypesOrthographic, ObliqueOne-, two-, three-point perspective

In short, parallel projection preserves shape and size for accurate measurement, whereas perspective projection sacrifices accuracy to give a realistic depth cue.

projection
6short5 marks

Explain the working of a CRT (Cathode Ray Tube) with a suitable diagram.

Working of a Cathode Ray Tube (CRT)

A CRT is the basic display device used in older monitors. It is an evacuated glass tube with the following main parts:

  • Electron gun – contains a heated cathode (filament) that emits electrons by thermionic emission, and a control grid that controls the number of electrons (beam intensity/brightness).
  • Focusing system – electrostatic/magnetic lenses that converge the electrons into a fine, sharp beam.
  • Deflection system – horizontal and vertical deflection plates/coils that steer the beam to the desired position on the screen.
  • Phosphor-coated screen – the front face; when the high-energy electron beam strikes it, the phosphor glows (fluoresces) and emits light at that spot.

Operation

Electrons emitted by the heated cathode are accelerated by a positive accelerating anode toward the screen, focused into a narrow beam, and deflected to a specific (x,y)(x,y) position. Where the beam hits, the phosphor emits a spot of light. Because the glow fades quickly (persistence), the picture must be redrawn many times per second (refreshing, typically 60 Hz or more) to avoid flicker.

Diagram (described): a horizontal tube with the electron gun (cathode, control grid, accelerating anode) at the narrow rear end, a focusing system, then vertical and horizontal deflection plates, opening out to the wide phosphor-coated screen at the front, with the electron beam shown travelling left to right and striking the screen.

display-devices
7short5 marks

Differentiate between object-space and image-space methods of hidden surface removal.

Object-Space vs Image-Space Methods (Hidden Surface Removal)

AspectObject-Space MethodImage-Space Method
Where it worksIn the world/object coordinate space, on the geometry of objectsIn the device/screen space, pixel by pixel
ComparisonCompares objects/surfaces with each other to decide visibilityDetermines, for each pixel, which surface is visible
PrecisionComputations done at object precision (exact)Done at display (pixel) resolution
CostTime grows with number of objects (~O(n2)O(n^2))Time grows with number of pixels × objects
Resolution dependenceIndependent of display resolutionDependent on display resolution
OutputResolution-independent description; can be scaledTied to a particular resolution
ExamplesBack-face detection, painter's (depth-sort) algorithmZ-buffer, scan-line, area-subdivision (Warnock)

Object-space methods are accurate but become expensive for many objects, whereas image-space methods scale with screen resolution and are simpler to implement in hardware.

hidden-surface
8short5 marks

What is a spline? Differentiate between interpolation and approximation splines.

Spline; Interpolation vs Approximation Splines

Spline

A spline is a smooth curve constructed to pass through or near a set of given points called control points. The term originates from a flexible strip (mechanical spline) bent through points. Mathematically a spline is a piecewise polynomial curve (e.g. cubic) joined so that it is continuous and smooth (positional, tangent, and sometimes curvature continuity, denoted C0,C1,C2C^0, C^1, C^2) at the joints. Common splines: Bezier, B-spline, Hermite.

Interpolation vs Approximation Splines

AspectInterpolation SplineApproximation Spline
Relation to control pointsCurve passes through every control pointCurve does not pass through all control points; it is guided/pulled toward them
FitExact fit to data pointsApproximate fit (smoother)
Control points act asPoints on the curvePoints that influence the curve's shape
Smoothness/controlCan wiggle to hit all pointsSmoother, easier shape control
ExamplesNatural cubic spline, Hermite (through endpoints)Bezier, B-spline curves

In short, an interpolation spline reproduces the data exactly by passing through the points, while an approximation spline trades exactness for a smoother, more controllable curve that merely approximates the control points.

curvesspline
9short5 marks

Explain the key frame system in computer animation.

Key Frame System in Computer Animation

A key frame is a frame that defines the important/extreme positions (the start and end points of a movement) of an object in an animation. In a key frame system, the animator (or lead) specifies only these key frames, and the computer automatically generates the in-between frames by a process called in-betweening or tweening.

Working

  1. The animator defines key frames at chosen times t1,t2t_1, t_2 for an object's parameters (position, shape, colour, orientation).
  2. The number of in-between frames is decided from the frame rate and time gap, e.g. for 1 s at 24 fps with key frames at the ends there are 22 in-betweens.
  3. The system interpolates parameter values between successive key frames:
P(t)=P1+(P2P1)tt1t2t1P(t) = P_1 + (P_2 - P_1)\,\frac{t - t_1}{t_2 - t_1}

for linear interpolation; non-linear (spline) interpolation is used for smooth ease-in/ease-out motion. 4. Object shapes can be transformed between key frames by morphing, matching the number of vertices/edges in the two key shapes.

Advantages

  • The animator controls only the important frames, saving large amounts of manual work.
  • Smooth, consistent motion is produced automatically; timing is easy to adjust by changing key-frame positions.
animation
10short5 marks

Explain the working principle of a Raster scan display and a Random (vector) scan display.

Raster Scan vs Random (Vector) Scan Displays

Raster Scan Display

The screen is a grid of pixels. The electron beam sweeps the screen horizontally, one scan line at a time, from top to bottom (left-to-right on each line, then retrace). The picture intensity for every pixel is held in a frame buffer (refresh buffer) in memory; as the beam scans, the intensity is read from the frame buffer and applied. After the bottom line, the beam returns to the top (vertical retrace) and the whole screen is refreshed (typically 60 Hz).

  • Suitable for realistic, filled, shaded images and photographs.
  • Image quality limited by resolution (pixel count); diagonal lines show staircase/aliasing.
  • Needs large frame-buffer memory.

Random (Vector / Stroke) Scan Display

The electron beam is deflected directly from one endpoint of a line to another, drawing only the line segments that make up the picture (it does not scan the whole screen). The component lines/curves are stored in a display file (refresh display list) and the beam is refreshed by re-tracing those segments (30–60 times/s).

  • Produces very smooth, sharp lines (no staircasing) at high resolution.
  • Good for line drawings, CAD, wireframes; cannot easily display shaded/solid areas or realistic images.
  • Refresh time depends on the number of lines (complex pictures may flicker).

Key difference: raster scan plots all pixels from a frame buffer (good for filled images), while random scan plots only the line segments directly (good for crisp line art).

graphics-systems
11short5 marks

Explain the DDA line drawing algorithm with its advantages and disadvantages.

DDA (Digital Differential Analyzer) Line Drawing Algorithm

The DDA is an incremental scan-conversion algorithm that draws a line by sampling it at unit intervals along the axis of greater change and computing the other coordinate from the slope m=y2y1x2x1m = \dfrac{y_2-y_1}{x_2-x_1}.

Algorithm

Input: endpoints (x1, y1), (x2, y2)
dx = x2 - x1;  dy = y2 - y1
steps = max(|dx|, |dy|)        // number of sampling steps
xInc = dx / steps;  yInc = dy / steps
x = x1;  y = y1
plot(round(x), round(y))
for i = 1 to steps:
    x = x + xInc
    y = y + yInc
    plot(round(x), round(y))

If m1|m|\le 1: increment xx by 1 and yy by mm each step; if m>1|m|>1: increment yy by 1 and xx by 1/m1/m. This guarantees no gaps in the line.

Advantages

  • Simpler and faster than directly evaluating the line equation y=mx+cy=mx+c at each point, because it uses only incremental addition (no repeated multiplication).
  • Easy to understand and implement.

Disadvantages

  • Uses floating-point arithmetic and round(), which are slow and prone to round-off accumulation, so points may drift away from the true line for long lines.
  • Floating-point operations make it slower than the all-integer Bresenham's algorithm, which is generally preferred.
line-drawingdda
12short5 marks

Derive the transformation matrix for rotation about an arbitrary point in 2D.

Rotation About an Arbitrary Point in 2D

A basic rotation matrix rotates a point only about the origin. To rotate about an arbitrary pivot point P(xp,yp)P(x_p, y_p) by angle θ\theta, we perform three steps using homogeneous coordinates:

Step 1 – Translate the pivot to the origin: T(xp,yp)T(-x_p,-y_p)

T(xp,yp)=[10xp01yp001]T(-x_p,-y_p)=\begin{bmatrix}1&0&-x_p\\0&1&-y_p\\0&0&1\end{bmatrix}

Step 2 – Rotate about the origin by θ\theta: R(θ)R(\theta)

R(θ)=[cosθsinθ0sinθcosθ0001]R(\theta)=\begin{bmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{bmatrix}

Step 3 – Translate the pivot back to its original position: T(xp,yp)T(x_p,y_p)

T(xp,yp)=[10xp01yp001]T(x_p,y_p)=\begin{bmatrix}1&0&x_p\\0&1&y_p\\0&0&1\end{bmatrix}

Composite Matrix

The overall transformation is M=T(xp,yp)R(θ)T(xp,yp)M = T(x_p,y_p)\cdot R(\theta)\cdot T(-x_p,-y_p). Multiplying:

M=[cosθsinθxp(1cosθ)+ypsinθsinθcosθyp(1cosθ)xpsinθ001]M=\begin{bmatrix} \cos\theta & -\sin\theta & x_p(1-\cos\theta)+y_p\sin\theta\\ \sin\theta & \cos\theta & y_p(1-\cos\theta)-x_p\sin\theta\\ 0 & 0 & 1 \end{bmatrix}

Thus a transformed point is given by [xy1]=M[xy1]\begin{bmatrix}x'\\y'\\1\end{bmatrix}=M\begin{bmatrix}x\\y\\1\end{bmatrix}, i.e.

x=xp+(xxp)cosθ(yyp)sinθx' = x_p + (x-x_p)\cos\theta - (y-y_p)\sin\theta y=yp+(xxp)sinθ+(yyp)cosθy' = y_p + (x-x_p)\sin\theta + (y-y_p)\cos\theta
transformation2d

Frequently asked questions

Where can I find the BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) question paper 2077?
The full BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2077 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Computer Graphics (BSc CSIT, CSC209) 2077 paper come with solutions?
Yes. Every question on this Computer Graphics (BSc CSIT, CSC209) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2077 paper?
The BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2077 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Computer Graphics (BSc CSIT, CSC209) past paper free?
Yes — reading and attempting this Computer Graphics (BSc CSIT, CSC209) past paper on Kekkei is completely free.