Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Assignment -2.

1 Computer Graphics

Name vicky morya UID - 20BCA1517

SECTION/GROUP 4-B BRANCH - UIC

SEMESTER - 5TH

SUBJECT NAME Computer DATE OF PERFORMANCE 15.10.22

Graphics All

Q 1 Transform the position of a rectangle with rotation matrix at 30 degree?

Ans 1

First, translate the Rectangle by Tx= -1 and Ty=0.

- Then rotate the Rectangle by 45 degree.

- Again translate the Rectangle by TX=1 and Ty=0.

Q 2 Explicate the window to view port transformation.

Ans 2 Window to Viewport Transformation is the process of transforming 2D


world-coordinate objects to device coordinates.

First, we construct the scene in world coordinate using the output primitives and
attributes.
To obtain a particular orientation, we can set up a 2-D viewing coordinate system
in the window coordinate plane and define a window in viewing coordinates
system.

Once the viewing frame is established, are then transform description in world
coordinates to viewing coordinates.

Then, we define viewport in normalized coordinates (range from 0 to 1) and map


the viewing coordinates description of the scene to normalized coordinates.

Q 3 Draft a short note on Following:

a) Scaling

b) Shearing

Ans 3

In computer graphics, scaling is a process of modifying or altering the size of


objects.

Shearing deals with changing the shape and size of the 2D object along x-axis and
y-axis.
Q 4 Explore the use of homogenous coordinate matrix? Write a standard form to
which all 2D transformations can be arranged?

Ans 4 The rotation of a point, straight line or an entire image on the screen, about
a point other than origin, is achieved by first moving the image until the point of
rotation occupies the origin, then performing rotation, then finally moving the
image to its original position.

1) translation {1 0 0}
{0 1 0}
{tx ty 1)

2) scailing {sx 0 0}
{ 0 sy 0}

{ 0 0 1}

Q 5 Illustrate Scaling transformations using diagram and matrices.

Ans 5 A scaling transformation alters size of an object. In the scaling process, we


either compress or expand the dimension of the object

Initial coordinates of the object O = (Xold, Yold)


Scaling factor for X-axis = Sx
Scaling factor for Y-axis = Sy
New coordinates of the object O after scaling = (Xnew, Ynew)
This scaling is achieved by using the following scaling equations-

Xnew = Xold x Sx
Ynew = Yold x Sy

In Matrix form, the above scaling equations may be represented as-


{ Xnew} = {SX 0} multiply { Xold}
{Ynew } = { 0 Sy} {Yold}

You might also like