0% found this document useful (0 votes)
4 views

COM422 Tesr Marking Scheme_2023

The document outlines a marking scheme for a Computer Graphics test, covering definitions, differences between raster and vector graphics, and algorithms such as Breshenham's Line algorithm. It also discusses transformations in computer graphics, including geometric and coordinate transformations, and provides examples of applying translation and rotation to points. The document includes specific questions and answers, along with marks allocated for each response.

Uploaded by

gidadonaima472
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

COM422 Tesr Marking Scheme_2023

The document outlines a marking scheme for a Computer Graphics test, covering definitions, differences between raster and vector graphics, and algorithms such as Breshenham's Line algorithm. It also discusses transformations in computer graphics, including geometric and coordinate transformations, and provides examples of applying translation and rotation to points. The document includes specific questions and answers, along with marks allocated for each response.

Uploaded by

gidadonaima472
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

COM422 Test MARKING SCHEME

Question One
(a) Define Computer graphic.
Ans:
(a) Computer Graphic is an act of drawing pictures, lines, charts etc. on a computer screen using a
programming language.” [2 Marks]
(b) Differentiate between Raster Graphic and Vector Graphic in Tabular Form?

Raster Graphics Vector Graphics

Raster images are the collection of the pixel. The Vector images are composed of paths.

Scan conversion is required. Scan Conversion is not required.

Vector Graphics are more costly compared


Raster Graphics are less costly.
to raster graphics.

Raster image takes less space to store. Vector image takes more space.

Raster graphics can draw mathematical curves, Vector graphics can only draw continuous
polygons, and boundaries. and smooth lines.

File Extension: .BMP, .TIF, .JPG etc. File Extension: .SVG, .PDF, .AI etc.
[ 6 Marks]
(c) In Which year was the first Digital Graphic Generated?
1940-1941 [2 Marks]

1|Page
Question Two
(a) With an aid of clear sketch, explain how the five components of CRT monitor
work.
Ans:

[4 Marks]

(b) Derive Breshenham’s Line algorithm.


Ans:
Breshenham’s Line algorithm determines the points of an n-dimensional raster that
should be selected in an order to form a close approximation to a straight line between
two points. [1 Marks]

(a) Derive the algorithm to support your Definition in (a) above.


Let the start coordinate be (x0, y0) and end coordinate be (xn, yn)

Step 1 [1 marks for each step = 4 Marks]

Let’s calculate the slope of: ∆x and ∆y

=> ∆x=xn-x0

∆y= yn-y0

Step 2:

2|Page
We need to calculate the decision parameter which is used to find the exact point to
draw a line: that is calculated as Pk= 2∆y-∆x

Step3:

Suppose current point is (xk, yk), next point would be (xk+1,yk+1)

We find the next point depending on value of decision parameters P k

case 1
if pk<0 Pk+1 =Pk+2∆y
xk+1=xk+1 current value Xk plus 1
and yk+1=yk
case 2
if Pk >=0  Pk+1 =Pk+2∆y-2∆x
xk+1=xk+1
yk+1=yk

Step 4
Repeat step 3 until end point is reach.
(b) What are the advantages of Breshenham’s Algorithm?
Ans
Advantages of Breshenham’s algorithm
1. It involves integer arithmetic, very simple.
2. It avoids the generation of duplicate point.
3. It can be implemented using hardware because it does not involve floating point.

[2Marks]

3|Page
Question THREE
a) What do you understand by transformation in the context of Computer
Graphics?
Ans:
The term Transformation is generally referred to as converting a graphic
into another graphic by applying some rules or algorithms. [2 Marks]

(b) What are the objectives of Transformation?

i. Geometric Transformation: When we are moving the picture, and the


background is fixed, then it is a Geometric Transformation.
ii. Coordinate Transformation: When we are moving the background,
and the picture is fixed, then it is Coordinate Transformation. [2 Marks]

(c) Given a Point with coordinates (1, 2). Apply the translation with distance 4
towards x-axis and 4 towards the y-axis. Find the new coordinates without
changing the radius Sketch the Graph before and after translation?
Solution: P = (x0, y0) = (2,4) [1 Marks]
Shift Vector = (Tx, Ty) = (4, 2) [1 Marks]
Let us assume the new coordinates of P = (x1, y1)
Now we are going to add translation vector and given coordinates, then
x1 = x0 + Tx = (2 + 4) = 6 [1 Marks]
y1 = y0 + Ty = (4 + 2) = 6 [1 Marks]
Thus, the new coordinates = (6,6) [1 Marks]

[2 Mark for the sketch]

4|Page
Question Four
(a) A line segment with the starting point (0, 0) and ending points (5, 5). Apply
45-degree rotation anticlockwise direction on the line. Find the new
coordinates of the line?

Solution- We can rotate the straight line by its endpoints with the same angle.
[each coordinate calculated correctly 4 Marks= 8 marks]
P1=P0 x Cos45 - Q0 x Sin45

 5 x 0.7 – 5 x 0.71
 0.7 – 3.55
 -2.85

Q1=P0 x Sin45 - Q0 x Cos45

 5 x 0.71 – 5 x 0.14
 3.55 – 0.7
 2.85

The New coordinate is (p0 , Q0)=(-2.85,2.85)


rotation angle of 45o

We have,
(P0, Q0) = (0, 0)
Rotation Angle () = 30°
Let the new coordinates of line = (P1, Q1)
We can apply the rotation matrix, then,
.

[correct sketch is 4 Marks]

Thus, the new endpoint coordinates of the line are = (P1, Q1) = (1.83, 6.83)

5|Page

You might also like