Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Explain Bresenham's line drawing algorithm. Using it, digitize a line from (20, 10) to (30, 18) showing all the computed pixel coordinates.

Bresenham's Line Drawing Algorithm

Bresenham's algorithm is an efficient, integer-only incremental method to scan-convert a line. It uses a decision parameter to choose, at each step, between the two candidate pixels nearest to the true line, avoiding floating-point arithmetic and rounding.

Derivation (for slope 0<m<10 < m < 1)

For a line y=mx+cy = mx + c with m=ΔyΔxm = \dfrac{\Delta y}{\Delta x}, after plotting pixel (xk,yk)(x_k, y_k) the next xx is xk+1x_k+1 and we must choose between yky_k (lower) and yk+1y_k+1 (upper). The decision parameter is:

p0=2ΔyΔxp_0 = 2\Delta y - \Delta x If pk<0:  yk+1=yk,pk+1=pk+2Δy\text{If } p_k < 0:\; y_{k+1}=y_k,\quad p_{k+1}=p_k + 2\Delta y If pk0:  yk+1=yk+1,pk+1=pk+2Δy2Δx\text{If } p_k \ge 0:\; y_{k+1}=y_k+1,\quad p_{k+1}=p_k + 2\Delta y - 2\Delta x
plot(x0, y0)
for each x from x0+1 to x1:
    if p < 0:  p += 2*dy
    else:      y++;  p += 2*dy - 2*dx
    plot(x, y)

Digitizing (20, 10) to (30, 18)

Δx=3020=10,Δy=1810=8,m=0.8\Delta x = 30-20 = 10,\quad \Delta y = 18-10 = 8,\quad m = 0.8 (so 0<m<10<m<1).

2Δy=16,2Δy2Δx=1620=42\Delta y = 16,\quad 2\Delta y - 2\Delta x = 16-20 = -4

Initial p0=2ΔyΔx=1610=6p_0 = 2\Delta y - \Delta x = 16-10 = 6. Start pixel (20,10)(20,10).

kkpkp_k(xk+1,yk+1)(x_{k+1}, y_{k+1})
06(21, 11)
12(22, 12)
2-2(23, 12)
314(24, 13)
410(25, 14)
56(26, 15)
62(27, 16)
7-2(28, 16)
814(29, 17)
910(30, 18)

Plotted pixels: (20,10), (21,11), (22,12), (23,12), (24,13), (25,14), (26,15), (27,16), (28,16), (29,17), (30,18).

line-drawing
2long10 marks

Derive the midpoint circle drawing algorithm. Use it to plot the points of a circle with radius 10 and centre at the origin for the first octant.

Midpoint Circle Drawing Algorithm

Derivation

For a circle of radius rr centred at the origin, the implicit function is:

f(x,y)=x2+y2r2f(x,y) = x^2 + y^2 - r^2

where f<0f<0 inside, f=0f=0 on, and f>0f>0 outside the circle. We use 8-way symmetry, computing only the second octant (xx from 0 to x=yx=y, where slope 1\le 1) and reflecting.

After plotting (xk,yk)(x_k, y_k), the next xx is xk+1x_k+1. We test the midpoint between the two candidate pixels yky_k and yk1y_k-1, i.e. at (xk+1,  yk12)(x_k+1,\; y_k-\tfrac12):

pk=f ⁣(xk+1,yk12)=(xk+1)2+(yk12)2r2p_k = f\!\left(x_k+1,\, y_k-\tfrac12\right) = (x_k+1)^2 + \left(y_k-\tfrac12\right)^2 - r^2
  • If pk<0p_k < 0: midpoint inside \Rightarrow choose yk+1=yky_{k+1}=y_k, and pk+1=pk+2xk+1+1p_{k+1}=p_k + 2x_{k+1}+1.
  • If pk0p_k \ge 0: midpoint outside \Rightarrow choose yk+1=yk1y_{k+1}=y_k-1, and pk+1=pk+2xk+1+12yk+1p_{k+1}=p_k + 2x_{k+1}+1 - 2y_{k+1}.

Starting at (0,r)(0, r), the initial decision parameter is:

p0=54r1rp_0 = \tfrac54 - r \approx 1 - r

Plotting for r=10r=10, centre origin (first octant)

p0=110=9p_0 = 1 - 10 = -9. Start (0,10)(0,10). Iterate until xyx \ge y.

xkx_kyky_kpkp_knext yy
010-910
110-610
210-110
31069
49-39
5988
6857
77(stop: x=yx=y)

First-octant pixels: (0,10), (1,10), (2,10), (3,10), (4,9), (5,9), (6,8), (7,7).

The full circle is obtained by reflecting these across all eight octants: (±x,±y)(\pm x,\pm y) and (±y,±x)(\pm y,\pm x).

circle
3long10 marks

What is 2D geometric transformation? Explain translation, rotation and scaling with their transformation matrices in homogeneous coordinates.

2D Geometric Transformation

A 2D geometric transformation is an operation that changes the position, orientation, or size of an object in the 2D plane by mapping each point (x,y)(x,y) to a new point (x,y)(x',y'). Using homogeneous coordinates a point is written as (x,y,1)(x, y, 1), so that all three basic transformations can be expressed as 3×33\times3 matrix multiplication and composed by multiplying matrices.

1. Translation

Shifts every point by (tx,ty)(t_x, t_y):

x=x+tx,y=y+tyx' = x + t_x,\qquad y' = y + t_y T=[10tx01ty001]T = \begin{bmatrix} 1 & 0 & t_x \\ 0 & 1 & t_y \\ 0 & 0 & 1 \end{bmatrix}

Homogeneous coordinates are needed because translation is not linear in (x,y)(x,y) alone (cannot be a 2×22\times2 matrix).

2. Rotation (about origin, angle θ\theta, counter-clockwise)

x=xcosθysinθ,y=xsinθ+ycosθx' = x\cos\theta - y\sin\theta,\qquad y' = x\sin\theta + y\cos\theta R=[cosθsinθ0sinθcosθ0001]R = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

3. Scaling (about origin, factors sx,sys_x, s_y)

x=sxx,y=syyx' = s_x \cdot x,\qquad y' = s_y \cdot y S=[sx000sy0001]S = \begin{bmatrix} s_x & 0 & 0 \\ 0 & s_y & 0 \\ 0 & 0 & 1 \end{bmatrix}

If sx=sys_x = s_y the scaling is uniform; otherwise it is differential. A point is transformed as P=MPP' = M \cdot P where P=[x  y  1]TP = [x\; y\; 1]^T, and composite transforms are formed by matrix multiplication (applied right to left).

transformation
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

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

Raster Scan vs Random (Vector) Scan Display

Raster Scan Display

The screen is a grid of pixels. The electron beam sweeps the entire screen one horizontal line (scan line) at a time, from top-left to bottom-right, in a fixed raster pattern. Picture intensity for every pixel is stored in a frame buffer (refresh buffer) in memory; the beam reads this buffer and turns the beam on/off (or sets intensity) as it scans. The whole screen is refreshed typically 60–80 times per second. Suited for realistic, shaded, filled images (used in TVs and modern monitors), but suffers from aliasing (staircase) effects and needs large 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 (not the whole screen). The picture is stored as a set of line-drawing commands in a display list / display file, which the display processor repeatedly executes to refresh the image. It produces smooth, high-resolution lines (no jagged edges) and is ideal for line drawings (CAD, engineering). However, it cannot easily display shaded/filled areas, and refresh time grows with picture complexity.

FeatureRaster ScanRandom Scan
DrawingLine by line, whole screenOnly the lines of the picture
StorageFrame buffer (pixel values)Display list (line commands)
Image qualityJagged edges; good for shadingSmooth lines; no shading
Best forPhotos, games, TVLine drawings, CAD
graphics-systems
5short5 marks

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

DDA (Digital Differential Analyzer) Line Algorithm

DDA is an incremental scan-conversion algorithm that computes intermediate pixel positions by sampling the line at unit intervals along the axis of greater change and rounding the result.

Algorithm

For a line from (x1,y1)(x_1,y_1) to (x2,y2)(x_2,y_2) with Δx=x2x1\Delta x = x_2-x_1, Δy=y2y1\Delta y = y_2-y_1:

steps = max(|dx|, |dy|)
x_inc = dx / steps
y_inc = dy / steps
x = x1;  y = y1
for i = 0 to steps:
    plot(round(x), round(y))
    x = x + x_inc
    y = y + y_inc

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.

Advantages

  • Simpler and faster than directly evaluating y=mx+cy = mx + c for every xx (no multiplication inside the loop).
  • Easy to understand and implement; works for lines of any slope.

Disadvantages

  • Uses floating-point arithmetic and round(), which is slower and less accurate than integer methods like Bresenham's.
  • Accumulation of round-off error can cause the plotted pixels to drift away from the true line for long lines.
line-drawingdda
6short5 marks

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

Rotation About an Arbitrary Point in 2D

The standard rotation matrix rotates about the origin only. To rotate an object by angle θ\theta about an arbitrary pivot point (xp,yp)(x_p, y_p), we compose three transformations:

  1. Translate the pivot to the origin: T(xp,yp)T(-x_p, -y_p).
  2. Rotate about the origin by θ\theta: R(θ)R(\theta).
  3. Translate back: T(xp,yp)T(x_p, y_p).

The composite matrix (applied right to left to a point) is:

M=T(xp,yp)R(θ)T(xp,yp)M = T(x_p, y_p)\cdot R(\theta)\cdot T(-x_p, -y_p) M=[10xp01yp001][cosθsinθ0sinθcosθ0001][10xp01yp001]M = \begin{bmatrix} 1 & 0 & x_p \\ 0 & 1 & y_p \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & -x_p \\ 0 & 1 & -y_p \\ 0 & 0 & 1 \end{bmatrix}

Multiplying gives:

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 the new coordinates are:

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
7short5 marks

Explain the Sutherland-Hodgman polygon clipping algorithm with an example.

Sutherland-Hodgman Polygon Clipping Algorithm

This algorithm clips a polygon against a convex clipping window by clipping the polygon successively against each window edge (left, right, bottom, top). The output polygon from clipping against one edge becomes the input for the next edge.

Procedure

For each clipping edge, the polygon's vertices are processed as ordered edges (SP)(S \to P). For each edge there are four cases (based on whether SS and PP are inside the boundary):

CaseSSPPOutput
1ininoutput PP
2inoutoutput intersection II
3outoutoutput nothing
4outinoutput II, then PP

Here II is the intersection of edge SPSP with the clipping boundary. After processing all four window edges, the remaining vertices form the clipped polygon.

Example

Clip triangle with vertices A(1,1),B(5,1),C(3,5)A(1,1), B(5,1), C(3,5) against the right window edge x=4x = 4:

  • Edge ABA\to B: both inside (x<4x<4) \Rightarrow output BB. (A handled by previous edge.)
  • Edge BCB\to C: BB inside, CC inside? CC has x=3<4x=3<4, inside; but B(5,1)B(5,1) is outside. So BB out, CC in \Rightarrow output intersection of BCBC with x=4x=4, then CC.

The result is a clipped polygon lying entirely within x4x \le 4. Limitation: it works correctly only for convex clipping windows and may leave spurious connecting edges when clipping concave polygons.

clippingpolygon
8short5 marks

Explain the RGB and CMY color models used in computer graphics.

RGB and CMY Color Models

RGB (Red, Green, Blue) Model

RGB is an additive color model based on adding light. The three primaries — Red, Green, Blue — are combined in varying intensities; adding all three at full intensity produces white, and zero of all three gives black. It is represented as a unit cube with the origin (0,0,0)(0,0,0) = black and (1,1,1)(1,1,1) = white. RGB is used by emissive devices that generate light: CRT/LCD monitors, TVs, scanners, and cameras.

e.g. (1,0,0)=Red,  (1,1,0)=Yellow,  (0,1,1)=Cyan\text{e.g. } (1,0,0)=\text{Red},\;(1,1,0)=\text{Yellow},\;(0,1,1)=\text{Cyan}

CMY (Cyan, Magenta, Yellow) Model

CMY is a subtractive color model based on absorbing (subtracting) light from white. Its primaries — Cyan, Magenta, Yellow — are the complements of RGB. Adding all three ideally gives black, and zero gives white (the paper). It is used by reflective devices such as printers and plotters where pigments absorb wavelengths.

Conversion

CMY is the complement of RGB (for unit-normalized values):

[CMY]=[111][RGB]\begin{bmatrix} C \\ M \\ Y \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} - \begin{bmatrix} R \\ G \\ B \end{bmatrix}

(In practice CMYK adds a black, KK, channel for true blacks and ink economy.)

color
9short5 marks

Write the transformation matrices for 3D translation, scaling and rotation about the x-axis.

3D Transformation Matrices (Homogeneous Coordinates)

In 3D, points are represented as (x,y,z,1)(x, y, z, 1) and transformations as 4×44\times4 matrices.

1. Translation by (tx,ty,tz)(t_x, t_y, t_z)

T=[100tx010ty001tz0001]T = \begin{bmatrix} 1 & 0 & 0 & t_x \\ 0 & 1 & 0 & t_y \\ 0 & 0 & 1 & t_z \\ 0 & 0 & 0 & 1 \end{bmatrix}

2. Scaling by factors (sx,sy,sz)(s_x, s_y, s_z) about origin

S=[sx0000sy0000sz00001]S = \begin{bmatrix} s_x & 0 & 0 & 0 \\ 0 & s_y & 0 & 0 \\ 0 & 0 & s_z & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

3. Rotation about the X-axis by angle θ\theta

The xx coordinate is unchanged; yy and zz rotate:

Rx(θ)=[10000cosθsinθ00sinθcosθ00001]R_x(\theta) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta & 0 \\ 0 & \sin\theta & \cos\theta & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

so that x=x,  y=ycosθzsinθ,  z=ysinθ+zcosθx'=x,\; y'=y\cos\theta - z\sin\theta,\; z'=y\sin\theta + z\cos\theta.

3dtransformation
10short5 marks

Explain the concept of window to viewport transformation.

Window-to-Viewport Transformation

A window is a rectangular region selected in the world-coordinate system that defines what part of the scene is shown. A viewport is a rectangular region on the display device (in device/screen coordinates) that defines where it is shown. The window-to-viewport transformation (viewing transformation) maps points from window coordinates to viewport coordinates while preserving relative positions.

Mapping

Let the window be bounded by (xwmin,ywmin)(xw_{min}, yw_{min})(xwmax,ywmax)(xw_{max}, yw_{max}) and the viewport by (xvmin,yvmin)(xv_{min}, yv_{min})(xvmax,yvmax)(xv_{max}, yv_{max}). A window point (xw,yw)(x_w, y_w) maps to viewport point (xv,yv)(x_v, y_v) keeping the same relative proportion:

xv=xvmin+(xwxwmin)Sx,Sx=xvmaxxvminxwmaxxwminx_v = xv_{min} + (x_w - xw_{min})\,S_x, \qquad S_x = \frac{xv_{max}-xv_{min}}{xw_{max}-xw_{min}} yv=yvmin+(ywywmin)Sy,Sy=yvmaxyvminywmaxywminy_v = yv_{min} + (y_w - yw_{min})\,S_y, \qquad S_y = \frac{yv_{max}-yv_{min}}{yw_{max}-yw_{min}}

SxS_x and SyS_y are the scaling factors. If Sx=SyS_x = S_y the aspect ratio is preserved; otherwise the image is stretched. The transformation is effectively translate window to origin → scale by (Sx,Sy)(S_x,S_y) → translate to viewport.

windowing
11short5 marks

Differentiate between parallel projection and perspective projection.

Parallel vs Perspective Projection

Projection transforms 3D objects onto a 2D view (projection) plane using projectors (lines from object points to the plane).

Parallel Projection

The projectors are parallel to one another (the centre of projection is at infinity). Object dimensions and parallelism are preserved, so it does not give a realistic sense of depth but is accurate for measurements. Used in engineering/CAD drawings (orthographic, oblique).

Perspective Projection

The projectors converge at a single point called the centre of projection (eye). Objects farther from the viewer appear smaller (foreshortening), giving a realistic appearance with vanishing points. Parallel lines (not parallel to the plane) appear to meet. Used in realistic rendering, games, and architecture views.

FeatureParallelPerspective
Centre of projectionAt infinityFinite point
ProjectorsParallelConverging
Size with distanceUnchangedDecreases (foreshortening)
RealismLess realisticMore realistic
Preserves dimensionsYesNo
UseCAD, engineeringGames, realistic views
projection
12short5 marks

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

Working of a CRT (Cathode Ray Tube)

A CRT is a vacuum tube that produces images by directing a focused beam of electrons onto a phosphor-coated screen.

Main Components and Operation

  1. Electron Gun (cathode + control grid): A heated cathode (filament) emits electrons by thermionic emission. The control grid regulates the number of electrons (beam intensity / brightness).
  2. Focusing System: Electrostatic (or magnetic) lenses converge the electrons into a fine, sharp beam so it strikes the screen as a small spot.
  3. Accelerating Anode: A high positive voltage accelerates the electrons toward the screen, giving them enough energy to excite the phosphor.
  4. Deflection System: Horizontal and vertical deflection plates (or coils) bend the beam to position the spot anywhere on the screen.
  5. Phosphor-Coated Screen: When the high-speed electrons strike the phosphor, it emits light at that point. The brief glow is called persistence; the image is kept visible by refreshing (redrawing) it many times per second (e.g. 60 Hz).

Diagram (described)

From left to right: heated cathode/filament → control grid → focusing anode → accelerating anode → (beam passes between) vertical and horizontal deflection plates → narrow beam → phosphor screen at the right where the glowing spot appears. The connecting electron beam runs along the central axis of the evacuated glass tube.

Color CRTs use three electron guns (R, G, B) and a shadow mask so each beam strikes only its corresponding phosphor dots.

display-devices

Frequently asked questions

Where can I find the BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) question paper 2079?
The full BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2079 (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) 2079 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) 2079 paper?
The BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2079 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.