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, incremental integer algorithm for scan-converting a line. It uses only integer addition, subtraction and bit-shifting (no floating point or division), choosing at each step the pixel closest to the true line by means of a decision parameter pkp_k.

Derivation (for 0m10 \le m \le 1, line drawn left to right)

At step kk the pixel (xk,yk)(x_k, y_k) has been plotted. The next xx is xk+1x_k+1 and the choice is between yky_k (lower) and yk+1y_k+1 (upper). With Δx=x2x1\Delta x = x_2-x_1, Δy=y2y1\Delta y = y_2-y_1 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:\quad 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:\quad y_{k+1}=y_k+1,\quad p_{k+1}=p_k+2\Delta y-2\Delta x

Algorithm

1. Input endpoints (x1,y1),(x2,y2)
2. dx = x2-x1, dy = y2-y1
3. Plot (x1,y1)
4. p = 2*dy - dx
5. for x = x1 to x2-1:
     if p < 0:  y stays;          p = p + 2*dy
     else:       y = y + 1;        p = p + 2*dy - 2*dx
     x = x + 1
     plot(x, y)

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

Δx=3020=10\Delta x = 30-20 = 10, Δy=1810=8\Delta y = 18-10 = 8. Since 0m=8/1010 \le m = 8/10 \le 1, step in xx.

2Δy=162\Delta y = 16,  2Δy2Δx=1620=4\ 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.

kpkp_ksignxk+1x_{k+1}yk+1y_{k+1}plotted
start62010(20,10)
06≥02111(21,11)
16+(−4)=2≥02212(22,12)
22+(−4)=−2<02312(23,12)
3−2+16=14≥02413(24,13)
414+(−4)=10≥02514(25,14)
510+(−4)=6≥02615(26,15)
66+(−4)=2≥02716(27,16)
72+(−4)=−2<02816(28,16)
8−2+16=14≥02917(29,17)
914+(−4)=10≥03018(30,18)

Pixels plotted: (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

The circle x2+y2=r2x^2+y^2=r^2 is symmetric in 8 octants, so we compute only the first octant (from x=0, y=rx=0,\ y=r to x=yx=y) and reflect. Define the circle function:

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

which is <0<0 inside, =0=0 on, and >0>0 outside the circle.

Having plotted (xk,yk)(x_k,y_k), the next xx is xk+1x_k+1; the choice is between yky_k and yk1y_k-1. We evaluate ff at the midpoint (xk+1, yk12)\left(x_k+1,\ y_k-\tfrac12\right), giving the decision parameter:

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 is inside ⇒ 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 is outside ⇒ 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}

Initial value at (0,r)(0,r):

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

Plotting for r=10r=10, centre (0,0)(0,0) — first octant

p0=110=9p_0 = 1-10 = -9. Start at (0,10)(0,10).

kpkp_kxk+1x_{k+1}yk+1y_{k+1}point
0−9110(1,10)
1−9+2(1)+1=−6210(2,10)
2−6+2(2)+1=−1310(3,10)
3−1+2(3)+1=649(4,9)
46+2(4)+1−2(9)=−359(5,9)
5−3+2(5)+1=868(6,8)
68+2(6)+1−2(8)=577(7,7)

Stop when xyx \ge y (here x=7,y=7x=7,y=7).

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

The full circle is obtained by 8-way symmetry: (±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 changes the position, orientation, size or shape of an object in the plane by modifying the coordinates of its defining points according to a rule. Using homogeneous coordinates a point (x,y)(x,y) is written as (x,y,1)(x,y,1), which lets translation, rotation and scaling all be expressed as 3×33\times3 matrix multiplications and combined (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,\ y'=y+t_y.

[xy1]=[10tx01ty001][xy1]\begin{bmatrix}x'\\y'\\1\end{bmatrix}=\begin{bmatrix}1 & 0 & t_x\\0 & 1 & t_y\\0 & 0 & 1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}

2. Rotation (about origin, angle θ\theta, anticlockwise)

x=xcosθysinθ,  y=xsinθ+ycosθx'=x\cos\theta-y\sin\theta,\ \ y'=x\sin\theta+y\cos\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}

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

x=sxx,  y=syyx'=s_x\,x,\ \ y'=s_y\,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 and distorts shape.

Composition: A sequence of transformations is applied by multiplying their matrices, e.g. rotate-then-translate =TR= T\cdot R, allowing complex transforms (like rotation about an arbitrary point) to be built from these basic ones.

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 screen row by row (left to right, top to bottom), one horizontal scan line at a time, refreshing the whole screen typically 60–80 times per second. The picture is stored as intensity values for every pixel in a memory area called the frame buffer (refresh buffer); the beam intensity is turned on/off according to these values. It can display filled areas, shaded regions and realistic images, and is the basis of modern displays (TV, monitors). Image quality depends on resolution, and lines may show a staircase (aliasing) effect.

Random / Vector Scan Display

The electron beam is deflected directly from one endpoint to another to draw line segments (strokes), tracing only the parts of the screen where the picture lies. The picture is stored as a set of line-drawing commands in a display file and redrawn (refreshed) ~30–60 times/sec. It produces smooth, high-resolution lines with no staircasing, but cannot easily display shaded/filled areas and is suited to line drawings (CAD, wireframes).

FeatureRaster scanVector scan
DrawingPixel by pixel, scan linesLine by line (endpoints)
StorageFrame buffer (pixel array)Display file (commands)
Filled areasYesDifficult
Line qualityStaircase/aliasingSmooth
UseRealistic images, modern displaysCAD line drawings
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 line-scan algorithm that samples the line at unit intervals along the axis of greater change and computes the other coordinate using the slope m=Δy/Δxm=\Delta y/\Delta x.

Algorithm

1. dx = x2 - x1,  dy = y2 - y1
2. steps = max(|dx|, |dy|)
3. xinc = dx/steps,  yinc = dy/steps
4. x = x1,  y = y1
5. for i = 0 to steps:
     plot(round(x), round(y))
     x = x + xinc
     y = y + yinc

Each new point is found by adding a constant increment, then rounding to the nearest pixel.

Advantages

  • Simpler and faster than the direct line equation (y=mx+cy=mx+c) since it avoids repeated multiplication; uses only repeated addition.
  • Works for lines of any slope.

Disadvantages

  • Uses floating-point arithmetic and rounding, which is slower and accumulates round-off error for long lines, causing the line to drift from its true path.
  • Round operation is time-consuming compared to Bresenham's pure-integer method, making DDA less efficient.
line-drawingdda
6short5 marks

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

Rotation About an Arbitrary Point in 2D

To rotate an object by angle θ\theta about an arbitrary pivot P(xp,yp)P(x_p, y_p) (not the origin), we perform three steps:

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

T1=[10xp01yp001]T_1=\begin{bmatrix}1 & 0 & -x_p\\0 & 1 & -y_p\\0 & 0 & 1\end{bmatrix}

Step 2 — Rotate about the origin by θ\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}

Step 3 — Translate back to PP: T(xp,yp)T(x_p,y_p)

T2=[10xp01yp001]T_2=\begin{bmatrix}1 & 0 & x_p\\0 & 1 & y_p\\0 & 0 & 1\end{bmatrix}

The composite matrix is M=T2RT1M = T_2 \cdot R \cdot T_1:

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\\[4pt]\sin\theta & \cos\theta & y_p(1-\cos\theta)-x_p\sin\theta\\[4pt]0 & 0 & 1\end{bmatrix}

Thus the transformed point is [xy1]=M[xy1]\begin{bmatrix}x'\\y'\\1\end{bmatrix}=M\begin{bmatrix}x\\y\\1\end{bmatrix}, giving:

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

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

Rule for each edge

For every polygon edge from vertex SS to vertex PP, four cases arise (with respect to the current clip boundary; inside = visible side):

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

Intersection II of edge SPSP with the boundary is computed by parametric/line equations.

Example

Clip triangle with vertices A(1,1), B(5,1), C(3,4)A(1,1),\ B(5,1),\ C(3,4) against a rectangular window xmin=2, xmax=4, ymin=0, ymax=3x_{min}=2,\ x_{max}=4,\ y_{min}=0,\ y_{max}=3.

  • Left edge x=2x=2: keep parts with x2x\ge2. Edge A ⁣ ⁣BA\!\to\!B (AA out, BB in) gives intersection (2,1)(2,1) then BB; B ⁣ ⁣CB\!\to\!C both in/cross; C ⁣ ⁣AC\!\to\!A gives intersection. Output replaces the left-cut corner with new vertices on x=2x=2.
  • The intermediate polygon is then clipped against right (x=4x=4), bottom (y=0y=0) and top (y=3y=3) edges in turn.

After all four passes the result is the polygon lying entirely inside the window. The algorithm is simple and well-suited to hardware, but for concave polygons it may produce extraneous connecting edges.

clippingpolygon
8short5 marks

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

RGB and CMY Colour Models

RGB Model (additive)

Uses the three primary colours of light — Red, Green, Blue — represented along the axes of a unit cube. Colours are formed by adding light:

Colour=Rr^+Gg^+Bb^,R,G,B[0,1]\text{Colour} = R\,\hat{r} + G\,\hat{g} + B\,\hat{b}, \quad R,G,B \in [0,1]
  • (0,0,0)(0,0,0) = black (origin), (1,1,1)(1,1,1) = white.
  • R+G+BR+G+B: Red+Green = Yellow, Green+Blue = Cyan, Red+Blue = Magenta.
  • Used by emissive devices: monitors, TVs, cameras, scanners.

CMY Model (subtractive)

Uses Cyan, Magenta, Yellow — the complements of RGB — which work by subtracting (absorbing) light reflected from a surface. Used for hard-copy/printing (inks/pigments on white paper):

  • (0,0,0)(0,0,0) = white (paper), (1,1,1)(1,1,1) = black.
  • Cyan absorbs red, Magenta absorbs green, Yellow absorbs blue.

Conversion

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

(In printing, CMYK adds a separate black, K, for richer blacks.)

color
9short5 marks

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

3D Transformation Matrices (Homogeneous Coordinates)

A 3D point is (x,y,z,1)(x,y,z,1) and transforms use 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 (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 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 is to be displayed. A viewport is a rectangular region of the device/screen (normalized) coordinates that defines where it will be displayed. The window-to-viewport (or viewing) transformation maps each point inside the window to a corresponding point inside the viewport, preserving relative positions.

A window point (xw,yw)(x_w, y_w) maps to viewport point (xv,yv)(x_v, y_v) by keeping equal relative position:

xvxvminxvmaxxvmin=xwxwminxwmaxxwmin\frac{x_v - x_{vmin}}{x_{vmax}-x_{vmin}} = \frac{x_w - x_{wmin}}{x_{wmax}-x_{wmin}} yvyvminyvmaxyvmin=ywywminywmaxywmin\frac{y_v - y_{vmin}}{y_{vmax}-y_{vmin}} = \frac{y_w - y_{wmin}}{y_{wmax}-y_{wmin}}

Solving gives:

xv=xvmin+(xwxwmin)sx,yv=yvmin+(ywywmin)syx_v = x_{vmin} + (x_w - x_{wmin})\,s_x, \qquad y_v = y_{vmin} + (y_w - y_{wmin})\,s_y

with scale factors

sx=xvmaxxvminxwmaxxwmin,sy=yvmaxyvminywmaxywmin.s_x=\frac{x_{vmax}-x_{vmin}}{x_{wmax}-x_{wmin}}, \qquad s_y=\frac{y_{vmax}-y_{vmin}}{y_{wmax}-y_{wmin}}.

This is equivalent to: translate the window to the origin, scale by (sx,sy)(s_x,s_y), then translate to the viewport position. If sxsys_x \ne s_y the image is distorted in aspect ratio.

windowing
11short5 marks

Differentiate between parallel projection and perspective projection.

Parallel vs Perspective Projection

Projection maps 3D points onto a 2D view (projection) plane using projectors. The two main classes differ in where the projectors converge.

AspectParallel ProjectionPerspective Projection
ProjectorsParallel to each other (centre of projection at infinity)Converge to a single point (centre of projection at finite distance)
Object sizePreserved regardless of distanceDistant objects appear smaller (foreshortening)
RealismLess realisticMore realistic (matches human eye/camera)
Parallel linesRemain parallelMay converge to vanishing point(s)
MeasurementsTrue dimensions kept; good for engineering/CADDimensions not preserved
TypesOrthographic, obliqueOne-, two-, three-point perspective
UseTechnical drawings, blueprintsAnimation, games, realistic scenes

Summary: Parallel projection preserves relative proportions and is used where accurate measurement matters; perspective projection adds depth realism by making farther objects smaller, at the cost of true scale.

projection
12short5 marks

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

Cathode Ray Tube (CRT)

A CRT is the basic display device that produces images by directing a focused beam of electrons onto a phosphor-coated screen.

Diagram (described)

A sealed, evacuated glass tube. From the rear: heated cathode/filament → control grid → focusing and accelerating anodes (electron gun) → horizontal & vertical deflection plates (or coils) → phosphor-coated screen at the front.

Working

  1. Electron generation: The heated cathode (filament) emits electrons by thermionic emission.
  2. Intensity control: The control grid regulates the number of electrons (beam intensity/brightness).
  3. Focusing & acceleration: The focusing anode narrows the electrons into a fine beam, and accelerating anodes speed them toward the screen.
  4. Deflection: Deflection plates/coils (horizontal and vertical) steer the beam to the required (x,y)(x,y) position on the screen.
  5. Light emission: The beam strikes the phosphor coating, which glows at the point of impact, creating a bright spot (pixel).
  6. Refresh: Phosphor glow fades, so the image must be redrawn (refreshed) many times per second (e.g. 60 Hz) to avoid flicker. Persistence is the time the phosphor keeps glowing.
display-devices

Frequently asked questions

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