[Intermediate] · Every exam and assignment question from SSG 511 (Computer Graphics, Systems Engineering, first semester 2025/2026) in one place, left unsolved on purpose. Each one points to the note that teaches the method. Where a figure or matrix was missing from the source text, that is flagged — the question can’t be answered without it.

How to use this: attempt closed-book, then check with the runnable code in the linked note (the Bresenham, Liang–Barsky and de Casteljau scripts are independent checks on hand work). Answers are deliberately not here — the value is in the attempt.


Exam paper (2 hours — answer question one and any other three)

Question 1

(a) Why are line and curve drawing algorithms important in computer graphics? State three reasons why Bresenham’s algorithm is preferred over the digital differential analyser (DDA) for practical applications. (5 marks) → note 02 §1, §4

(b) With illustration, derive an expression to execute Bresenham’s algorithm with slope greater than one. Given two end points and , construct a table and produce the plot to rasterise A and B. (15 marks) → note 02 §4

(c) A particle is animated in so that it starts at at and arrives at at . The initial velocity is and the final velocity is . The motion is modelled with a degree-three Bézier curve . → note 06 §4

  • (i) Derive the equations for computing the position and velocity of the particle AND give the control points and . (6 marks)
  • (ii) Find the position of the particle at . (3 marks)
  • (iii) The “first half” of the curve is . Express as a degree-three Bézier curve by giving its four control points. (6 marks)

Question 2 (10 marks)

Refer to Fig. 1 — a square with vertices , , , , divided into four smaller squares by a horizontal and a vertical line through the middle ( is the bottom-right corner). Draw its image after being transformed by each matrix: → note 05

(a) (b) (c)

Hint: decide the vector convention first. Matrix (a)‘s layout is the row-vector form of an anticlockwise rotation — and that choice changes what (c) means. See note 05’s “Check your understanding” Q1.

Question 3 (10 marks)

The inkjet technology is widely used in industry for marking and coding, and reposes on the emission of charged droplets at high velocity and high frequency. Give a detailed step-by-step account of the numerical modelling of the ink jet breakup process in COMSOL Multiphysics. → note 20 (not in the lecture notes; taken from a published COMSOL paper)

Question 4 (10 marks)

Consider a cone of height one unit, with apex at and a base of diameter one unit centred at the origin. Transform it so that the apex is at , the base is centred at , and the base’s diameter is two units. What transformations are required, and in what order? Write down the product of the individual transformation matrices. → note 05 §6

Question 5

(a) Give a detailed description of how Cohen–Sutherland can be used to clip a straight-line segment against a rectangle. (6 marks) → note 04 §3

(b) Consider the window region A–D of a clipped line with coordinates and . Determine whether the lines –, –, –, – and – can be clipped or not, and perform the clipping on each as appropriate. (4 marks)

Hint: is the lower-left corner (giving , ) and the upper-right. Codes and accept/reject tests first; intersections only for lines that pass neither.

Question 6 (10 marks)

Develop a program to implement Bresenham’s line drawing algorithm. Ensure it uses only integer arithmetic. The code should handle slopes with and correctly plot pixels for user-defined start and end points. Justify your results with three use cases. → note 02 §6

Exam coverage

QuestionTopicNoteIn the lecture-note PDF?
1(a)Why line algorithms matter; Bresenham vs DDA13Partly (pp. 2–3)
1(b)Bresenham derivation, ; table13No
1(c)Cubic Bézier: position, velocity, control points, , first half17Yes (pp. 104–107)
2Transform a square with three matrices16Yes (ch. 3, pp. 10–16)
3Inkjet breakup in COMSOL20No — needs the lecturer’s material
4Transform a cone in 3D16Yes (§5.5, p. 27)
5Cohen–Sutherland: description and five lines15No
6Bresenham program, three use cases13No

Strategy: Q1 is compulsory, and Q2, Q4, Q5 and Q6 are all covered — Q3 is the one to leave until last or skip. Study order: Bresenham first (Q1b is 15 marks and Q6 reuses it), then Bézier (Q1c), transformations (Q2, Q4), Cohen–Sutherland (Q5).


Assignment Part A — programming tasks

All in note 02.

  1. Implement DDA. Prompt for start and end coordinates, draw the line, plotting the intermediate pixels.
  2. Implement Bresenham with integer arithmetic only, for the first octant (), for user-defined end points.
  3. One application that switches between DDA and Bresenham for the same segment, displaying both (different colours or slightly offset) to compare end-point accuracy and smoothness.
  4. Extend Bresenham to any slope (positive, negative, vertical, horizontal) in all quadrants, using , and the right increments.
  5. Draw simple 2D shapes (triangle, rectangle, arbitrary polygon) from input vertices by calling the line function in sequence.
  6. DDA by hand, compared with the program: to .
  7. Full-octant integer Bresenham by hand, compared with the program: a “cross” of – () and – ().
  8. A regular hexagon centred at with radius 50 — you supply the six vertices.
  9. Toggle standard/styled lines: a dashed rectangle with vertices , , , .

Assignment Part B — transformations, clipping and curves

B-1. Draw the figure’s image under each of (i), (ii), (iii) individually, not cumulatively. The square is , , , ; (i) is a 30° rotation, (ii) is . ⚠️ (iii)‘s matrix was not in the source text. → note 05 (part (i) is worked there)

B-2. Fig. 1 shows a complicated 2D transformation applied to a unit square. Describe it in terms of simpler transformations, give a homogeneous matrix for each, and use them to find the image of point . ⚠️ Figure not in the source text. → note 05

B-3. A triangle with vertices , , as homogeneous column vectors , , , in an orthonormal basis (first unit vector right, second up). → note 05

  • a. A matrix that translates the triangle 5 units to the left.
  • b. A matrix that rotates it 90° anticlockwise.
  • c. A matrix that translates it 5 units left and rotates it 90° anticlockwise about its own origin (point in its original coordinates).
  • d. Under an affine the triangle maps to , , . Find .

B-4. Homogeneous coordinates in 3D (Fig. 2). → note 05 §5

  • (i) How do you convert to homogeneous coordinates, and back?
  • (ii) What types of transformation does each of the four blocks (…, …, …, ) provide?
  • (iii) What transformation does each matrix in Fig. 4 produce? ⚠️ Matrices not in the source text.

B-5. Square and rectangle A′B′C′D′. ⚠️ Figure not in the source text. → note 05

  1. A matrix, or product of matrices, that transforms into A′B′C′D′.
  2. What happens if the same transformation is applied to A′B′C′D′?

B-6. A homographic transformation of a 3D point as a 4 × 4 matrix product. → note 05

  • (a) For each given matrix, identify the basic transformation(s) (translation, scaling, rotation, projection), naming any rotation axis and the order. ⚠️ Matrices not in the source text.
  • (b) The cone — same as exam Q4. No need to multiply the matrices out.

B-7. Clipping. ⚠️ The three example lines were in a figure not in the source text. → note 04

  1. Describe an algorithm for clipping a line against a rectangle, and show it works on the three examples.
  2. Describe Cohen–Sutherland in detail.
  3. Extend the algorithm from (1) to clip a line against a 3D viewing frustum.
  4. Describe how to clip a Bézier curve against a screen rectangle.
  5. Apply Cohen–Sutherland to – and – against the window , , , .

B-8. The derivative of a Bézier curve: , , , so — a degree- Bézier with control points . (Signs and ranges in the pasted original were garbled; this is the standard form — check against the slides.) A particle starts at at and arrives at at , with initial velocity and final velocity , on a cubic Bézier. → note 06

  • (a) Give .
  • (b) Find the position at (the source read “t = 12”).
  • (c) Express the first half as a cubic Bézier by its four control points.

B-9. A cubic Bézier with , , , (the source labelled the last two , ). → note 06

  • (a) Sketch and label the control points and the control polygon.
  • (b) Use de Casteljau to compute .
  • (c) Sketch the curve approximately, to scale, showing the initial and final points and slopes.

B-10. A particle in on a cubic Bézier: at it is at with velocity ; at at with velocity . → note 06

  • a. The control points ….
  • b. Draw them and the control polygon.
  • c. Calculate , showing the work on the same graph.
  • d. Sketch the curve for with the start and end slopes shown.
  • e. The second half () is also a cubic Bézier. Its control points?

B-11.

  • (a) Define computer graphics and explain its applications. → note 01
  • (b) List the major differences between DDA and Bresenham. For and , write code that runs Bresenham, develop the table, and show the plot. If the and axes in A and B were switched, derive an expression (with a diagram) for Bresenham connecting the new points A′ and B′, plot A′B′ and compare with . → note 02

Supplementary questions

  1. Define antialiasing. → note 02 §8
  2. Translate triangle , , by 2 units in and 3 in . → note 05
  3. What is the computational complexity of basic DDA? Of Bresenham? What makes Bresenham more efficient? → note 02 §5
  4. (a) Describe in detail an algorithm that returns the minimum distance from a point to a line segment in 2D. Include all assumptions and calculations. → note 06 §8
  5. (b) A quadratic Bézier , . Describe an algorithm that draws it with straight lines only, to within tolerance . You may use (a) and assume a line-drawing routine. → note 06 §8
  6. (c) Find a Bézier curve through with slope 2 and through with slope 3. Sketch it. → note 06 §5(c)

Still to confirm with the lecturer

  • Rows 2–5 of the “five areas of improvement in GUI operations” list (note 01) — written from slide titles only.
  • Whether there are COMSOL slides for Q3.
  • The lecturer’s version of Chaikin’s algorithm (note 06 §7).
  • The figures and matrices flagged ⚠️ above.
↑ Back to Computer Graphics