computer graphics excerices, Exams of Computer Graphics

answer an questions with summary

Typology: Exams

2018/2019

Uploaded on 01/13/2019

Itarek898
Itarek898 🇪🇬

1 document

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COMPUTER GRAPHICS
SAMPLE QUESTIONS AND ANSWERS
1. What is an output primitive?
Graphics programming packages provide function to describe a scene in terms of these basic
geometric structures, referred to as output primitives.
2. What is point in the computer graphics system?
The point is a most basic graphical element & is completely defined by a pair of user coordinates
(x , y).
Define Circle?
Circle is defined by its center xc, yc and its radius in user coordinate units. The equation
of the circle is (x-xc) + (y-yc) = r2.
3. Define Ellipse?
An ellipse can use the same parameters xc, yc ,r as a circle, in addition to the
Eccentricity e. the eqn of an ellipse is:
(x-xc)2/a2 + (y-yc)2/b2 = 1
4. What is Transformation?
Transformation is the process of introducing changes in the shape size and
orientation of the object using scaling rotation reflection shearing & translation etc.
5. Write short notes on active and passive transformations?
In the active transformation the points x and x F 0 7 C
represent different coordinates of the
same coordinate system. Here all the points are acted upon by the same transformation and
hence the shape of the object is not distorted. In a passive transformation the points x and x F 0 7 C
represent same points in the space but in a different coordinate system. Here the change in the
coordinates is merely due to the change in the type of the user coordinate system.
6. What is translation?
Translation is the process of changing the position of an object in a straight-line path
from one coordinate location to another. Every point (x , y) in the object must undergo a
displacement to (x F0 7 C
,y F 0 7 C
). The transformation is:
xF 0 7 C
= x + tx ;
y F 0 7 C
= y+ty
pf3
pf4
pf5

Partial preview of the text

Download computer graphics excerices and more Exams Computer Graphics in PDF only on Docsity!

COMPUTER GRAPHICS

SAMPLE QUESTIONS AND ANSWERS

  1. What is an output primitive?

Graphics programming packages provide function to describe a scene in terms of these basic geometric structures, referred to as output primitives.

  1. What is point in the computer graphics system?

The point is a most basic graphical element & is completely defined by a pair of user coordinates (x , y). Define Circle?

Circle is defined by its center xc, yc and its radius in user coordinate units. The equation of the circle is (x-xc ) + (y-y (^) c ) = r^2.

  1. Define Ellipse?

An ellipse can use the same parameters xc, yc ,r as a circle, in addition to the Eccentricity e. the eqn of an ellipse is:

(x-xc)^2 /a^2 + (y-yc)^2 /b^2 = 1

  1. What is Transformation?

Transformation is the process of introducing changes in the shape size and orientation of the object using scaling rotation reflection shearing & translation etc.

  1. Write short notes on active and passive transformations?

In the active transformation the points x and x F 0 7 C represent different coordinates of the same coordinate system. Here all the points are acted upon by the same transformation and hence the shape of the object is not distorted. In a passive transformation the points x and x F 0 7 C represent same points in the space but in a different coordinate system. Here the change in the coordinates is merely due to the change in the type of the user coordinate system.

  1. What is translation?

Translation is the process of changing the position of an object in a straight-line path from one coordinate location to another. Every point (x , y) in the object must undergo a displacement to (x F 0 7 C ,y F 0 7 C ). The transformation is:

x F 0 7 C^ = x + tx ; y F 0 7 C = y+ty

What is rotation? A 2-D rotation is done by repositioning the coordinates along a circular path, in the x-y

plane by making an angle with the axes. The transformation is given by: X

F 0 7 C = r cos (θ +

φ) and Y

F 0 7 C = r sin (θ + φ).

  1. What is scaling?

The scaling transformations changes the shape of an object and can be carried out by multiplying each vertex (x,y) by scaling factor Sx,Sy where Sx is the scaling factor of x and Sy is the scaling factor of y.

  1. What is shearing?

The shearing transformation actually slants the object along the X direction or the Y direction as required.ie; this transformation slants the shape of an object along a required plane.

  1. What is reflection?

The reflection is actually the transformation that produces a mirror image of an object. For this use some angles and lines of reflection.

D e t a i l e d A n s w e r s

  1. Explain in detail about the DDA scan conversion algorithm?

The digital differential analyzer is a scan conversion algorithm based on calculation either y or x using the following equations

y = m x

x = y / m

Sample the line at unit intervals in one coordinate and determine corresponding integer

values nearest the line path for the coordinates

Sample at X intervals ( x = 1) and compute each successive Y value as Yk+

= Yk + m

P0 = 2 y – x

Step 4 : At each Xk along the line, starting at k = 0, perform the following test If Pk

< 0, the next point to plot is (Xk+1, Y (^) k) and Pk+1 = P (^) k+2 y Otherwise, the next point to plot is (Xk+1, Y (^) k+1) and

Pk+1 = P^ k+2^ y - 2^ x

Step 5: Repeat step 4 x times

  1. Discuss the Midpoint Circle algorithm?

Algorithm

Step 1:Input radius r and circle center(Xc, Yc)and obtain the first point on the circumference of a circle centered on the origin as (X0, Y0) = (0, r)

Step 2: Calculate the initial values of the decision parameter as

P0 = 5/4 – r

Step 3: At each position starting at k perform the following test:

If Pk < 0, the next point to plot is (Xk+1, Yk ) and P^ k+1 = P^ k+ Xk+1 + 1

Otherwise the next point is (Xk+1, Y (^) k+1) and P (^) k+1 = Pk +2 Xk+1 + 1- 2 Y (^) k-

Step 4: Determine symmetry points in the other seven octants

Step 5: Move each pixel position(X, Y) onto the circular path centred on (Xc, Yc) and plot the coordinate values as X = X + Xc Y = Y + Yc

Step 6: Repeat steps 3 through until X>=Y Pk + 1= Pk + 2 Y

Other wise, the next point is (Xk+1, Y^ k+1) and

Pk + 1= Pk + 2 Y - 2 X

Step 5: Repeat steps 4 X times

  1. (^) Write short notes on Ellipse generating

Algorithm?

Algorithm

Step 1:Input radius r (^) x , r (^) y and ellipse center(X (^) c , Yc )and obtain the first point on the circumference of a circle centered on the origin as

(X 0 , Y 0 ) = (0, ry)

Step 2: Calculate the initial values of the decision parameter in region 1 as P1 0 =^ ry^2 -

rx^2 ry + 1/4 r x^2

Step 3: At each position starting at Xk position in region 1,starting at k = 0, perform the following test:

If Pk < 0, the next point to plot is (Xk+1, Y^ k) and P1^ k+1 =

P1k +2 ry^2 Xk+1 + ry^2

Otherwise the next point is (X (^) k+1, Y (^) k-1 ) and P1k+1 = P1k+2 r (^) y^2 X (^) k+

  • 2r (^) y^2 Yk+1 + r (^) y^2

Step 4: Calculate the initial values of the decision parameter in region 2 as P2 0 = ry^2 (X 0

+1/2)^2 + r x^2 (Y 0 – 1) 2 - rx^2 ry^2

Step 5: At each position starting at Yk position in region 2,starting at k = 0, perform the following test: If Pk > 0, the next point to plot is (X^ k, Yk-1 ) and

P2k+1 = P2 k - 2 r y^2 Yk+1 + rx^2

Otherwise the next point is (Xk+1, Y (^) k-1) and

P2k+1 = P2 k - 2 r y^2 Yk+1 - 2 r x^2 Yk+1 + rx^2

Step 4 : Starting with pixel position (xa, ya), determine the offset needed at each step to generate

the next pixel position along the line path. Step 5: loop the following process for steps number of times a. Use a unit of increment or decrement in the x and y direction

b. if xa is less than xb the values of increment in the x and y directions are 1 and m

c. if xa is greater than xb then the decrements -1 and – m are used.