BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) Question Paper 2078 Nepal
This is the official BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) question paper for 2078, as set in the regular annual examination. It carries 100 full marks and a time allowance of 180 minutes, across 14 questions. On Kekkei you can attempt this Computer Graphics (PU, CMP 234) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) exam or solving previous years' question papers, this 2078 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt all / any as specified.
(a) With the help of a neat block diagram, explain the architecture of a raster-scan display system. Differentiate between raster-scan and random-scan (vector) display systems on the basis of refresh mechanism, image quality, and suitability for solid-area scenes. (8)
(b) A raster system is designed using a resolution of 1280 × 1024 with a color depth of 24 bits per pixel. Calculate the total size of the frame buffer required in megabytes. If the display refreshes at 60 Hz, determine the access (read) rate per pixel in nanoseconds. (4)
(c) Define aspect ratio and persistence of a phosphor. Why is persistence an important parameter in the design of a CRT display? (3)
(a) Raster-scan display architecture and comparison
Architecture (block diagram, described): The CPU sends graphics commands to the display controller / graphics processor. The image is stored as an array of intensity values in the frame buffer (refresh buffer) in system or video memory. A video controller reads the frame buffer pixel-by-pixel, in scan-line order, converts the digital values to analog voltages through a DAC, and drives the electron gun of the CRT. Horizontal and vertical deflection circuits sweep the beam across the screen.
CPU --> Display Processor --> Frame Buffer --> Video Controller --> DAC --> CRT (electron gun + deflection)
The beam scans the entire screen left-to-right, top-to-bottom (raster), turning each pixel on/off according to the frame-buffer value, then retraces. The screen is redrawn (refreshed) typically 60-80 times per second.
Raster vs Random (Vector) scan:
| Basis | Raster-scan | Random-scan (Vector) |
|---|---|---|
| Refresh mechanism | Beam sweeps the whole screen pixel-by-pixel in a fixed scan-line pattern; refreshed from frame buffer | Beam moves only along the lines/strokes of the picture; refreshed from a display file of line commands |
| Image quality | Limited by resolution; staircase (jagged) edges due to discrete pixels | Smooth, sharp lines of high resolution; no jaggedness |
| Suitability for solid-area scenes | Excellent — can fill areas, display shaded/realistic images and photographs | Poor — can draw outlines/wireframes only; cannot easily fill solid areas |
(b) Frame buffer size and access rate
Resolution pixels. Color depth bits bytes/pixel.
At 60 Hz, total pixels read per second pixels/s.
Frame buffer = 3.75 MB; access rate ≈ 12.7 ns per pixel.
(c) Aspect ratio and persistence
- Aspect ratio: the ratio of the horizontal extent (width) to the vertical extent (height) of the displayed image, e.g. . It fixes the proportion of horizontal to vertical pixels needed to draw equal-length lines.
- Persistence: the time taken for the emitted light of a CRT phosphor to decay to (10%) of its initial intensity after the electron beam is removed.
Importance: Persistence determines the minimum refresh rate needed to avoid flicker. A short-persistence phosphor decays quickly and must be refreshed at a higher rate; a long-persistence phosphor holds the image longer (good for static images) but smears moving images. Persistence therefore directly governs flicker, refresh-rate design, and suitability for animation.
(a) Derive the decision parameter for the Bresenham's line drawing algorithm for a line with slope 0 < m < 1, clearly stating the assumptions made and the incremental update of the decision variable for both possible pixel choices. (8)
(b) Using the midpoint circle drawing algorithm, plot the pixel positions for a circle of radius r = 8 centred at the origin. Show the calculation of the decision parameter for the first octant in tabular form, and explain how the eight-way symmetry is used to obtain the remaining pixels. (7)
(a) Bresenham's line algorithm decision parameter (0 < m < 1)
Assumptions: the line is drawn from to with slope ; is the fast (unit-increment) axis. Endpoints are integers. At each step increases by 1 and we must decide whether stays the same or increases by 1.
The line equation: with . Rewrite as the implicit form
After plotting , the candidates are the lower pixel and the upper pixel . Let and be the vertical distances from the true line at to these pixels. Define the decision parameter
Working this out gives
Initial value:
Incremental update (the two pixel choices):
- If : the lower pixel is closer. Choose and
- If : the upper pixel is closer. Choose and
Only integer additions are used, so the algorithm is fast and avoids floating-point.
(b) Midpoint circle algorithm, r = 8, centre origin
Decision parameter starts at . Begin at and step in the first octant until .
- If : next pixel , .
- If : next pixel , .
| Step | ||
|---|---|---|
| start | -7 | (0, 8) |
| 1 | -7 → -4 | (1, 8) |
| 2 | -4 → 1 | (2, 8) |
| 3 | 1 → -6 | (3, 7) |
| 4 | -6 → 3 | (4, 7) |
| 5 | 3 → -2 | (5, 6) |
| 6 | -2 → 11 | (6, 6) → stop (x ≥ y at next) |
First-octant pixels: .
Eight-way symmetry: for every computed point in one octant, the remaining seven pixels are obtained by reflecting across the axes and the lines :
Thus only of the circle is computed; the rest is plotted by symmetry (offset by the centre), saving computation.
(a) Distinguish between parallel projection and perspective projection. Explain, with diagrams, oblique and orthographic parallel projections, and define the terms centre of projection, vanishing point, and view plane. (8)
(b) Derive the 4 × 4 homogeneous transformation matrix for a perspective projection onto the z = 0 plane with the centre of projection located at a distance d along the negative z-axis. (4)
(c) Why are homogeneous coordinates used in 3D transformations? Explain how a single composite matrix can represent a sequence of rotation, scaling, and translation operations. (3)
(a) Parallel vs Perspective projection
| Parallel projection | Perspective projection |
|---|---|
| Projectors are parallel; centre of projection at infinity | Projectors converge to a finite centre of projection |
| Preserves relative proportions and true dimensions | Objects farther away appear smaller (foreshortening) |
| Less realistic, used in engineering drawings | More realistic, mimics the human eye/camera |
| No vanishing points | Has one, two, or three vanishing points |
Orthographic parallel projection: projectors are perpendicular to the view plane (e.g. front, top, side views). Lengths parallel to the plane are preserved.
Oblique parallel projection: projectors are parallel but strike the view plane at an oblique (non-90°) angle, so one face is shown true-size while depth is shown along an inclined direction (e.g. Cavalier, Cabinet projections).
Definitions:
- Centre of projection (COP): the point from which all projectors emanate (the eye/camera position in perspective).
- Vanishing point: the point on the view plane where projected parallel lines (not parallel to the plane) appear to converge.
- View plane (projection plane): the plane onto which the 3D scene is projected to form the 2D image.
(b) Perspective projection matrix onto z = 0, COP at (0,0,-d)
A point is projected by a line from the COP to the point, intersecting the plane . By similar triangles the projected coordinates are
In homogeneous coordinates this is achieved by
Applying it: . Dividing by the homogeneous coordinate gives , , as required.
(c) Homogeneous coordinates
Homogeneous coordinates represent a 3D point as a 4-tuple . They are used because translation cannot be expressed as a matrix multiplication — it is additive. Embedding points in 4D lets translation, rotation, scaling, and projection all be written as matrix multiplications. Because matrix multiplication is associative, a sequence of operations can be pre-multiplied once into a single composite matrix
and every vertex is then transformed by a single multiplication , which is far more efficient than applying each transform separately.
(a) Explain the Cohen–Sutherland line clipping algorithm. Describe the assignment of region (outcodes) to the endpoints and the use of logical AND/OR operations to trivially accept or reject a line segment. (7)
(b) A clipping window is defined by the corners (x_min, y_min) = (1, 1) and (x_max, y_max) = (9, 8). Using the Cohen–Sutherland algorithm, clip the line segment with endpoints P1(0, 3) and P2(11, 6). Show the outcodes and compute the coordinates of the clipped (visible) segment. (8)
(a) Cohen–Sutherland line clipping algorithm
The algorithm clips a line against a rectangular window using 4-bit region (outcodes). The plane is divided into 9 regions by extending the window edges. Each endpoint gets a 4-bit code (TBRL = Top, Bottom, Right, Left):
- bit 1 (Top): set if
- bit 2 (Bottom): set if
- bit 3 (Right): set if
- bit 4 (Left): set if
Tests using logical operations:
- Trivial accept: if both codes are
0000(logical OR of the two codes = 0), the line is wholly inside — accept it. - Trivial reject: if the logical AND of the two codes ≠ 0, both endpoints lie outside the same side, so the line is entirely outside — reject it.
- Otherwise: the line crosses a boundary. Pick an endpoint that is outside, find its intersection with the corresponding window edge, replace that endpoint with the intersection point, recompute its outcode, and repeat until trivial accept or reject.
Intersection with a vertical edge : . With a horizontal edge : .
(b) Clipping P1(0,3)–P2(11,6) against window (1,1)–(9,8)
Slope
Outcodes:
- P1(0,3): ⇒ Left bit set ⇒
0001. - P2(11,6): ⇒ Right bit set ⇒
0010.
OR = 0011 ≠ 0 (not trivially accepted); AND = 0000 (not trivially rejected) ⇒ must clip.
Clip P1 against left edge :
New P1 , outcode 0000 (inside).
Clip P2 against right edge :
New P2 , outcode 0000 (inside).
Both endpoints now inside ⇒ trivial accept.
Clipped visible segment: from to .
Section B: Short Answer Questions
Attempt all / any as specified.
A triangle is defined by the vertices A(2, 2), B(6, 2), and C(4, 6). Perform a reflection of the triangle about the line y = x, and write down the new coordinates of the vertices. Show the transformation matrix used and verify one vertex by hand calculation.
Reflection of triangle about the line y = x
Reflection about swaps the and coordinates: .
Transformation matrix (homogeneous form):
New vertices:
| Original | Reflected |
|---|---|
| A(2, 2) | A'(2, 2) |
| B(6, 2) | B'(2, 6) |
| C(4, 6) | C'(6, 4) |
Verification of vertex B(6, 2):
Thus .
Obtain the composite transformation matrix to rotate an object by an angle θ about an arbitrary pivot point (x_p, y_p) in 2D. List the sequence of basic transformations involved and explain why the order of matrix multiplication matters.
Rotation by θ about an arbitrary pivot (x_p, y_p)
Rotation matrices are defined about the origin only, so the pivot must first be moved to the origin. The required sequence is:
- Translate the pivot to the origin: .
- Rotate by about the origin: .
- Translate back: .
Composite matrix (applied right-to-left to a point):
Why order matters: matrix multiplication is not commutative (). The transformations must be applied in the correct sequence (translate-to-origin, rotate, translate-back). Reversing the order — e.g. rotating before translating the pivot to the origin — rotates the object about the origin instead of the pivot, giving a wrong result.
Define a Bézier curve. Write the blending (Bernstein) functions for a cubic Bézier curve with four control points P0, P1, P2, P3, and state the key geometric properties of Bézier curves (endpoint interpolation, convex hull, and tangent conditions).
Bézier curve
A Bézier curve is a parametric curve defined by a set of control points , where the curve is a weighted blend of the control points using Bernstein polynomials as blending functions, with parameter :
Cubic Bézier (4 control points, n = 3) blending functions:
so
Key geometric properties:
- Endpoint interpolation: the curve passes through the first and last control points, and .
- Convex hull: the curve lies entirely within the convex hull of its control points (since the blending functions are non-negative and sum to 1).
- Tangent (endpoint) conditions: the tangent at the start is along and at the end along ; i.e. , .
Differentiate between interpolation and approximation splines. Explain the meaning of parametric continuity (C0, C1, C2) and geometric continuity (G0, G1) at the join point of two curve segments.
Interpolation vs Approximation splines
- Interpolation spline: the curve passes through all the given control points; the control points lie on the curve (e.g. natural cubic spline, Catmull-Rom). Used when the path must hit specific data points.
- Approximation spline: the curve is guided by but does not necessarily pass through all control points; the points act as a control polygon that pulls the curve toward them (e.g. B-spline, Bézier interior points). Gives smoother, more controllable shapes.
Parametric continuity (C)
Measured by matching parametric derivatives at the join of two segments:
- C0: the two segments meet (same position at the join) — positional continuity only.
- C1: C0 and equal first parametric derivatives (same tangent vector, both magnitude and direction).
- C2: C1 and equal second parametric derivatives (same curvature behaviour).
Geometric continuity (G)
Requires only that the directions of derivatives match (magnitudes may differ):
- G0: the segments meet (same position) — identical to C0.
- G1: the tangent directions are equal at the join, but their magnitudes may differ. (Hence C1 ⇒ G1, but G1 does not imply C1.)
Geometric continuity is a less strict condition than parametric continuity and is often visually sufficient for smooth-looking joins.
Explain the Z-buffer (depth-buffer) algorithm for hidden surface removal. Write the algorithm in steps, state the two buffers required, and discuss its main advantages and limitations compared to the painter's (depth-sort) algorithm.
Z-buffer (depth-buffer) algorithm
The Z-buffer is an image-space hidden-surface-removal method that resolves visibility at each pixel by comparing depth () values.
Two buffers required:
- Frame (refresh) buffer — stores the colour/intensity of each pixel.
- Depth (Z) buffer — stores the depth of the closest surface seen so far at each pixel.
Algorithm:
1. Initialise depth buffer to maximum depth (e.g. z = far/∞) for all pixels.
Initialise frame buffer to background colour.
2. For each polygon in the scene:
For each pixel (x, y) covered by the polygon:
Compute the depth z of the polygon at (x, y).
If z is closer than depthBuffer[x][y]:
depthBuffer[x][y] = z
frameBuffer[x][y] = colour of polygon at (x, y)
3. Display the frame buffer.
Depth across a polygon is computed incrementally from the plane equation, so only an addition is needed per pixel along a scan line.
Advantages (vs painter's / depth-sort):
- Simple to implement; no sorting of polygons required.
- Handles interpenetrating and cyclically overlapping polygons correctly, which the painter's algorithm cannot.
- Polygons can be processed in any order; easily hardware-accelerated.
Limitations:
- Requires extra memory for the depth buffer.
- Limited depth precision can cause z-fighting for surfaces very close in depth.
- Does not directly handle transparency/anti-aliasing without extension.
In contrast, the painter's algorithm sorts polygons back-to-front and paints them in that order; it uses less memory but fails for overlapping/cyclic polygons and the sort is costly.
What is back-face detection? Given a polygon surface with outward normal N = (A, B, C) and a viewing direction along the positive z-axis, state the condition under which the polygon is identified as a back face and can be culled.
Back-face detection
Back-face detection is a hidden-surface-removal technique that identifies and removes (culls) the polygon faces of a closed solid that point away from the viewer, because such faces are hidden by the front faces and need not be rendered. This speeds up rendering by roughly halving the polygons processed.
Condition: A polygon is a back face if its outward normal makes an angle greater than 90° with the viewing direction , i.e.
For the standard case with the viewer looking along the positive z-axis and normal , the viewing direction is , so
Therefore the polygon is a back face (and is culled) when (its normal has a positive z-component, pointing in the same direction as the viewer's line of sight, i.e. away from the viewer). If it is a front face and is kept; means the face is viewed edge-on.
Compare Gouraud shading and Phong shading with respect to the quantity interpolated across the polygon, computational cost, and quality of specular highlights produced. Explain why Phong shading renders highlights more accurately.
Gouraud vs Phong shading
| Aspect | Gouraud shading | Phong shading |
|---|---|---|
| Quantity interpolated | Vertex intensities (colours) are computed at each vertex, then linearly interpolated across the polygon | Surface normals are interpolated across the polygon; the illumination equation is evaluated at every pixel |
| Computational cost | Cheaper — lighting computed only at vertices | More expensive — lighting (and normal normalisation) computed per pixel |
| Specular highlights | Poor — highlights are smeared or missed if they fall between vertices | Accurate, smoothly rounded highlights regardless of polygon size |
Why Phong renders highlights more accurately: A specular highlight is a small, sharply varying region of the intensity function. In Gouraud shading, intensity is only sampled at the vertices and linearly interpolated, so a highlight that occurs in the interior of a polygon (not at a vertex) is averaged out or lost — and large polygons show banding (Mach bands). Phong shading instead interpolates the normal vector and recomputes the full specular term at every pixel, so the highlight's true position and sharp falloff are captured, producing realistic, well-rounded highlights.
State the Phong illumination model and write its equation including the ambient, diffuse, and specular components. Define each term and explain the role of the shininess (specular reflection) coefficient.
Phong illumination model
The Phong model expresses the reflected intensity at a surface point as the sum of three components — ambient, diffuse, and specular:
Terms:
- — ambient term: background light reflected uniformly; is the ambient reflection coefficient.
- — diffuse (Lambertian) term: depends on the angle between the surface normal and the light direction ; is the diffuse coefficient. Independent of viewer position.
- — specular term: the shiny highlight, depending on the angle between the reflected-light direction and the viewer direction ; is the specular coefficient.
Here is the point-light intensity, and all vectors are unit vectors.
Shininess / specular exponent : it controls the size and sharpness of the highlight. A large (e.g. 100+) gives a small, tight, bright highlight typical of a smooth, polished/metallic surface; a small (e.g. 1) gives a large, soft, spread-out highlight typical of a dull surface. Because is , raising it to a higher power makes the term fall off rapidly as moves away from .
Explain the Sutherland–Hodgeman polygon clipping algorithm. Describe the four possible cases that arise when an edge of the polygon is processed against a single clip boundary, and state one limitation of this algorithm for concave polygons.
Sutherland–Hodgeman polygon clipping
This is a divide-and-conquer polygon-clipping algorithm. The polygon is clipped against one window edge at a time (left, right, bottom, top in turn); the output vertex list from one stage becomes the input to the next. The whole subject polygon is processed against each clip boundary, producing a new (possibly larger) vertex list.
Each edge of the polygon, from vertex (start) to vertex (end), is tested against the current clip boundary. Four cases arise (output the points marked → ):
- Both S and P inside: the edge is fully visible → output P.
- S inside, P outside (leaving): → output the intersection point I of edge with the boundary.
- S outside, P inside (entering): → output the intersection I and then P (two points).
- Both S and P outside: the edge is fully outside → output nothing.
After all four boundaries are processed, the resulting vertex list is the clipped polygon.
Limitation for concave polygons: when a concave polygon is clipped, the algorithm can produce extraneous connecting edges (spurious lines joining separate visible regions). Because the output is a single ordered vertex list, two disjoint pieces of a clipped concave polygon get joined by an unwanted edge running along the window boundary, so the result is not rendered correctly. (Weiler–Atherton clipping is used to handle concave polygons properly.)
Write short notes on any two of the following:
(a) Boundary-fill and flood-fill algorithms for area filling
(b) Aliasing and anti-aliasing techniques
(c) Scan-line polygon fill algorithm
Short notes (any two)
(a) Boundary-fill and Flood-fill
Both are seed-fill area-filling algorithms that start from an interior seed pixel and spread to neighbours (4-connected or 8-connected).
- Boundary-fill: fills the region by recursively colouring pixels outward from the seed until a specified boundary colour is reached. It stops when it hits the boundary colour or the new fill colour. Used when the region is bounded by a single known colour.
- Flood-fill: replaces all connected pixels that have a specified old (interior) colour with the new colour, regardless of the boundary colour. Used when the interior has one colour but the boundary is multi-coloured (e.g. recolouring a region).
Key difference: boundary-fill is defined by the boundary colour, flood-fill by the interior (old) colour.
(b) Aliasing and anti-aliasing
- Aliasing: the distortion artifacts (staircase/jagged edges on lines, loss of fine detail) caused by representing continuous geometry on a discrete pixel grid with insufficient sampling.
- Anti-aliasing techniques to reduce it:
- Supersampling (SSAA): render at higher resolution and average down.
- Area sampling: set pixel intensity proportional to the fraction of the pixel area covered by the primitive.
- Pixel-weighting / filtering: weight a pixel's contribution by a filter centred on it. These smooth edges by assigning intermediate intensities to boundary pixels.
(c) Scan-line polygon fill
Fills a polygon one horizontal scan line at a time:
- For each scan line , find the intersections of that line with all polygon edges.
- Sort the intersection -values left to right.
- Pair them up (1–2, 3–4, …) and fill the pixels between each pair (odd-parity rule — pixels inside the polygon lie between an odd and even crossing). An edge table and an active-edge list make the intersection computation incremental (each new ). Vertices are counted carefully so that local maxima/minima are not double-counted.
Frequently asked questions
- Where can I find the BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) question paper 2078?
- The full BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) 2078 (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 (PU, CMP 234) 2078 paper come with solutions?
- Yes. Every question on this Computer Graphics (PU, CMP 234) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
- How many marks is the BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) 2078 paper?
- The BE Computer Engineering (Pokhara University) Computer Graphics (PU, CMP 234) 2078 paper carries 100 full marks and is meant to be completed in 180 minutes, across 14 questions.
- Is practising this Computer Graphics (PU, CMP 234) past paper free?
- Yes — reading and attempting this Computer Graphics (PU, CMP 234) past paper on Kekkei is completely free.