PadhaikoAll subjects

Past exam question: 2081 Chaitra (Regular), Q3(a)

Computer Graphics and Visualization · 4 marks

Open in the Padhaiko app

Topic: 2D & Composite Transformations; Window-to-Viewport

Question

Suppose there is a rectangle whose coordinates are A(1,1), B(4,1), C(4,4), D(1,4) and the window coordinates are (2,2), (5,2), (5,5), (2,5) and the given viewport location is (0.5,0), (1,0), (1,0.5), (0.5,0.5). Calculate the viewing transformation.

Solution

Identification of Window and Viewport Extents: From the given boundaries:

Viewing Transformation Equations and Matrix: The window-to-viewport coordinate mapping equations maintain relative position:

Substituting the numerical parameters:

The composite viewing transformation matrix :

Transforming the Given Rectangle Vertices: Applying the transformation equations to the vertices , , , and :

  1. For :
  1. For :
  1. For :
  1. For :
Answer:

The window-to-viewport transformation matrix is:

with mapping formulas and . The transformed viewport coordinates of the rectangle are:

All past exam questions for Computer Graphics and Visualization