BSc CSIT (TU) Science Computer Graphics (BSc CSIT, CSC209) Question Paper 2078 Nepal
This is the official BSc CSIT (TU) (Science stream) Computer Graphics (BSc CSIT, CSC209) question paper for 2078, as set in the regular annual examination. It carries 60 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Computer Graphics (BSc CSIT, CSC209) 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 BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 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 any TWO questions.
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 technique that fills a polygon one horizontal scan line at a time, working from the top scan line to the bottom.
Working principle: For each scan line that crosses the polygon, find the intersection points of the scan line with all polygon edges, sort these x-coordinates in ascending order, pair them up (1st with 2nd, 3rd with 4th, ...) and fill the pixels between each pair. This relies on the fact that a closed polygon is crossed an even number of times by any horizontal line.
Steps:
- Find and of the polygon.
- For each scan line from to :
- Compute the x-intersections of the scan line with each edge.
- Sort the intersections by x.
- Fill pixels between pairs of intersections.
Edge / vertex handling: Horizontal edges are ignored. If a scan line passes exactly through a vertex, count it once if the two edges meeting at that vertex lie on the same side, and twice if they lie on opposite sides (achieved in practice by shortening the upper edge by one scan line).
For efficiency an Edge Table (ET) and an Active Edge Table (AET) are used. Each AET entry stores , and as increases by 1 the x value is incremented by (coherence).
Example: For a triangle with vertices , scan line intersects edge at and edge at . So pixels from to on row are filled. Repeating for all rows fills the whole triangle.
Boundary Fill Algorithm
This is a seed-fill technique used when a region is defined by a boundary of a single specified color. Starting from an interior seed pixel, it recursively colours neighbouring pixels until the boundary color is reached.
4-connected version:
boundaryFill(x, y, fillColor, boundaryColor):
current = getPixel(x, y)
if current != boundaryColor and current != fillColor:
setPixel(x, y, fillColor)
boundaryFill(x+1, y, fillColor, boundaryColor)
boundaryFill(x-1, y, fillColor, boundaryColor)
boundaryFill(x, y+1, fillColor, boundaryColor)
boundaryFill(x, y-1, fillColor, boundaryColor)
- 4-connected: checks left, right, up, down neighbours. May fail to fill regions that are connected only diagonally.
- 8-connected: also checks the four diagonal neighbours; fills more complex regions but can leak across thin boundaries.
Example: To fill a circle drawn in red (boundary color) with blue, pick an interior seed (e.g. the centre) and call boundaryFill(cx, cy, blue, red). The recursion spreads outward in all directions until every pixel until the red boundary is turned blue.
Comparison: The scan-line method works directly from the polygon's vertex list and is efficient/non-recursive, suited to rendering. Boundary fill works on an already-drawn region in the frame buffer (e.g. interactive paint tools) and is simple but memory-heavy due to recursion.
Explain Bezier curves and their properties. Derive the equation of a cubic Bezier curve with four control points.
Bezier Curves
A Bezier curve is a parametric polynomial curve defined by a set of control points . For a parameter the curve is
where are the Bernstein basis polynomials
Properties
- Endpoint interpolation: the curve passes through the first and last control points, and .
- Tangency: the curve is tangent to at the start and to at the end.
- Convex-hull property: the curve lies entirely within the convex hull of its control points.
- Partition of unity: , giving affine invariance (transform the curve by transforming control points).
- Degree: control points give a curve of degree ; it is non-local — moving any control point changes the whole curve.
- Symmetry: reversing the control points gives the same curve traced in the opposite direction.
Derivation: Cubic Bezier Curve (four control points)
For a cubic curve , with control points . The Bernstein basis polynomials of degree 3 are:
Therefore
In matrix form:
Verification: and , confirming endpoint interpolation. The derivative gives and , confirming tangency to the first and last edges of the control polygon.
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 draws a line using only integer arithmetic (additions/subtractions and comparisons), avoiding the floating-point operations and rounding of DDA. At each step it chooses the pixel closest to the true line by tracking a decision parameter.
For a line with slope from to , let , .
Initial decision parameter:
At each step, increments by 1, and:
- If : choose , and .
- If : choose , and .
Digitizing the line from (20, 10) to (30, 18)
, . Slope (so , x is the driving axis).
- , .
- .
Start by plotting .
| k | Sign | Next pixel | |
|---|---|---|---|
| 0 | 6 | (21, 11) | |
| 1 | 2 | (22, 12) | |
| 2 | -2 | (23, 12) | |
| 3 | 14 | (24, 13) | |
| 4 | 10 | (25, 14) | |
| 5 | 6 | (26, 15) | |
| 6 | 2 | (27, 16) | |
| 7 | -2 | (28, 16) | |
| 8 | 14 | (29, 17) | |
| 9 | 10 | (30, 18) |
Computed pixels: (20,10), (21,11), (22,12), (23,12), (24,13), (25,14), (26,15), (27,16), (28,16), (29,17), (30,18).
The end point is reached exactly, confirming the digitization is correct.
Section B: Short Answer Questions
Attempt any EIGHT questions.
Differentiate between object-space and image-space methods of hidden surface removal.
Hidden-surface removal methods are classified by the space in which the visibility comparison is performed.
| Aspect | Object-space method | Image-space method |
|---|---|---|
| Domain of computation | Works in the world/object coordinate system on geometric primitives (polygons, surfaces) | Works at the pixel level in screen/device coordinates |
| Comparison | Compares objects/parts of objects with each other | Compares depths at each pixel along the line of sight |
| Precision | High (computed with object precision, resolution independent) | Limited to display/pixel resolution |
| Cost | Grows rapidly with number of objects ( comparisons) | Grows with number of pixels (resolution); good for many objects |
| Output | A precise list/ordering of visible surfaces | A coloured pixel for each screen point |
| Examples | Back-face detection, Roberts' algorithm, BSP-tree | Z-buffer (depth-buffer), Scan-line, Painter's algorithm, Warnock's area-subdivision |
In short, object-space methods determine visibility analytically among objects and are accurate but expensive for complex scenes, whereas image-space methods determine visibility for each pixel of the display and scale better with scene complexity but are limited to screen resolution.
What is a spline? Differentiate between interpolation and approximation splines.
Spline
A spline is a smooth piecewise-polynomial curve that passes through or near a set of given points called control points. The term originates from the flexible strip (also called a spline) draughtsmen used to draw smooth curves through pegs. Mathematically, a spline curve is constructed from polynomial sections joined at points called knots, with continuity conditions (, , — positional, tangent and curvature continuity) imposed at the joints so the overall curve is smooth.
Interpolation vs Approximation Splines
| Basis | Interpolation Spline | Approximation Spline |
|---|---|---|
| Relation to control points | The curve passes through every control point | The curve only approximates / is guided by the control points (need not pass through interior ones) |
| Use | Used to digitize/fit a curve to known data points | Used to design a smooth shape steered by a control polygon |
| Control | Less designer control; curve forced through points, may oscillate | Better control of smoothness; convex-hull bounded |
| Example | Natural cubic spline, Hermite, Cardinal/Catmull-Rom spline | Bezier curve, B-spline |
Summary: If the polynomial sections are fitted so the curve goes through each control point, it is an interpolation spline; if the control points only influence the shape (the curve is pulled toward but generally does not touch them), it is an approximation spline.
Explain the key frame system in computer animation.
Key Frame System in Computer Animation
A key frame is a frame at a specific point in the animation sequence at which the animator explicitly defines the important positions, shapes or states of the objects (the "extremes" of a motion). A key frame system generates the complete animation from a relatively small set of these key frames.
Working principle:
- The animator (or lead artist) creates the key frames — e.g. frame 1 (start pose) and frame 30 (end pose).
- The system automatically generates all the in-between frames by interpolating between successive key frames. This automatic generation is called in-betweening or tweening.
- Interpolation may be linear (constant change per frame) or use non-linear/spline interpolation for smooth acceleration and deceleration (ease-in / ease-out).
Interpolation example: If an object is at position in key frame and in key frame , an in-between frame at parameter is
Morphing: When the two key frames have different shapes or different numbers of vertices, a transformation called morphing is used to add/adjust vertices so that one object smoothly transforms into the other across the in-between frames.
Advantages: Greatly reduces the animator's workload (only key poses are drawn), and produces smooth, controllable motion. It is the basis of most 2D and 3D animation packages.
Explain the working principle of a Raster scan display and a Random (vector) scan display.
Raster Scan Display
In a raster scan display, the electron beam sweeps across the screen one row (scan line) at a time, from top to bottom, covering the entire screen area.
- The picture is stored as a set of intensity/color values for every pixel in a memory area called the frame buffer (refresh buffer).
- As the beam moves along each scan line, its intensity is turned on/off (and colored) according to the corresponding pixel values in the frame buffer.
- After completing the bottom line, the beam returns to the top-left (vertical retrace); after each line it returns to the start of the next line (horizontal retrace).
- The whole screen is refreshed typically 60–80 times per second to avoid flicker.
- Suited to displaying shaded, filled and realistic images (photographs); resolution and quality are limited by frame-buffer size, and lines can show a staircase / aliasing effect.
Random (Vector) Scan Display
In a random/vector scan display the electron beam is directed only to the parts of the screen where a picture is to be drawn, tracing the component lines directly (point-to-point), not pixel-by-pixel.
- The picture is stored as a set of line-drawing commands in an area called the display file / display list, processed by the display processor.
- The beam draws each line segment directly between its endpoints, so lines are smooth with no staircase effect and very high resolution.
- Refresh rate depends on the number of lines (typically 30–60 times/sec); a complex picture with many lines may flicker.
- Best for line drawings, wireframes, engineering and CAD diagrams, but it cannot easily display realistic shaded/filled images.
Key difference: Raster scan refreshes pixel-by-pixel from a frame buffer (good for solid/shaded images); vector scan draws line-by-line from a display list (good for crisp line art).
Explain the DDA line drawing algorithm with its advantages and disadvantages.
DDA (Digital Differential Analyzer) Line Drawing Algorithm
DDA is an incremental scan-conversion algorithm that calculates pixel positions along a line by sampling the line at unit intervals along the driving axis and computing the other coordinate using the slope.
For a line from to , let , .
Steps:
- ,
- Start at ; plot
round(x), round(y). - Repeat
stepstimes: , , plotround(x), round(y).
If , increments by 1 and by ; if , increments by 1 and by .
Advantages:
- Simpler and faster than the direct line equation , since it avoids a multiplication per pixel (uses only additions).
- Easy to understand and implement.
Disadvantages:
- Uses floating-point arithmetic and a round() operation at each step, which is slower than pure integer arithmetic.
- Accumulation of round-off error over a long line can cause the plotted pixels to drift away from the true line.
- Slower than Bresenham's algorithm, which uses only integer operations.
Derive the transformation matrix for rotation about an arbitrary point in 2D.
Rotation about an Arbitrary Point in 2D
The basic rotation matrix rotates a point about the origin. To rotate about an arbitrary pivot point by angle , we compose three transformations:
- Translate the pivot to the origin: .
- Rotate about the origin by : .
- Translate back to the original pivot: .
Using homogeneous coordinates, the composite matrix is
With
Multiplying these gives
Thus the rotated point is , i.e.
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 entire polygon successively against each of the four window edges (left, right, bottom, top), one edge at a time. The output polygon from one edge becomes the input to the next.
Procedure: For the current clip edge, process each polygon edge defined by consecutive vertices and apply these four cases (output kept vertices in order):
| Case | S (start) | E (end) | Output |
|---|---|---|---|
| 1 | inside | inside | output E |
| 2 | inside | outside | output intersection point |
| 3 | outside | inside | output intersection, then E |
| 4 | outside | outside | output nothing |
After processing all four window edges, the remaining vertex list is the clipped polygon.
Example: Clip a triangle with vertices against the rectangular window with .
- Right edge (): inside, outside output intersection of with , which is . outside, inside output intersection of with , ... after processing the new polygon is .
- Top edge (): clip the result so that any vertex with (e.g. ) is replaced by the intersection points where the edges cross .
Clipping against the remaining edges (left , bottom ) leaves those vertices unchanged here. The final clipped polygon is the part of the triangle lying inside the rectangle, bounded by the original interior edges and the window edges and .
Limitation: Works correctly only for convex clipping windows; for a concave polygon being clipped it may produce extraneous connecting edges (handled better by Weiler–Atherton).
Explain the RGB and CMY color models used in computer graphics.
RGB Color Model
The RGB model is an additive color model based on the three primary colors of light: Red, Green, Blue. Colors are produced by adding these primaries in varying intensities; it is represented as a unit cube in Cartesian coordinates.
- Origin = black; the diagonally opposite corner = white.
- The main diagonal from black to white represents shades of grey.
- at full intensity gives white: . Also Yellow, Cyan, Magenta.
- Used by emissive devices: CRT/LED monitors, TV screens, scanners, digital cameras.
CMY Color Model
The CMY model is a subtractive color model based on Cyan, Magenta, Yellow — the complements (secondaries) of RGB. Colors are produced by subtracting light from white (e.g. by pigments/inks on paper that absorb certain wavelengths).
- = white (no ink); = black (all inks).
- subtracts all light to give black.
- Used by reflective devices: printers and hard-copy/plotting devices. (In practice CMYK adds a separate black ink K for richer blacks.)
Relationship
RGB and CMY are complementary. The conversion is simply:
In short: RGB is additive (light, displays, black at origin), CMY is subtractive (pigment, printing, white at origin).
Write the transformation matrices for 3D translation, scaling and rotation about the x-axis.
3D Transformation Matrices (Homogeneous Coordinates)
A point is represented as and transformed by a matrix.
1. Translation by
Gives .
2. Scaling by factors
Gives (scaling is about the origin).
3. Rotation about the x-axis by angle
The -coordinate is unchanged; the and coordinates rotate.
Gives .
(Positive follows the right-hand rule looking from toward the origin.)
Frequently asked questions
- Where can I find the BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) question paper 2078?
- The full BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 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 (BSc CSIT, CSC209) 2078 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) 2078 paper?
- The BSc CSIT (TU) Computer Graphics (BSc CSIT, CSC209) 2078 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.