All Exams Test series for 1 year @ ₹349 only
Question

A normalized matrix that maps a 3D window specified by coordinates (1, 1, 1) and (4, 5, 6) on to a viewport specified by coordinates (2, 4, 2) and (8, 10, 8) is

The correct answer is
$\begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{3}{2} & 0 & \frac{5}{2} \\ 0 & 0 & \frac{6}{5} & \frac{4}{5} \\ 0 & 0 & 0 & 1 \end{bmatrix}$

Window to Viewport Transformation Matrix

The transformation from a 3D window to a viewport involves scaling and translation. We need to find the matrix that maps the window coordinates to the viewport coordinates.

1. Calculate Scaling Factors

The scaling factor for each axis is the ratio of the viewport dimension to the window dimension.

  • X-axis: Window range = $4 - 1 = 3$. Viewport range = $8 - 2 = 6$. Scaling factor $Sx = \frac{6}{3} = 2$.
  • Y-axis: Window range = $5 - 1 = 4$. Viewport range = $10 - 4 = 6$. Scaling factor $Sy = \frac{6}{4} = \frac{3}{2}$.
  • Z-axis: Window range = $6 - 1 = 5$. Viewport range = $8 - 2 = 6$. Scaling factor $Sz = \frac{6}{5}$.

2. Determine Translation Components

The transformation can be represented as mapping the window's minimum coordinate to the viewport's minimum coordinate, followed by scaling. The general form of the transformation for a point $(x_w, y_w, z_w)$ to $(x_{vp}, y_{vp}, z_{vp})$ is:

$x_{vp} = Sx \cdot (x_w - x_{w_{min}}) + x_{vp_{min}}$ $y_{vp} = Sy \cdot (y_w - y_{w_{min}}) + y_{vp_{min}}$ $z_{vp} = Sz \cdot (z_w - z_{w_{min}}) + z_{vp_{min}}$

Substituting the values:

  • $x_{vp} = 2 \cdot (x_w - 1) + 2 = 2x_w - 2 + 2 = 2x_w$
  • $y_{vp} = \frac{3}{2} \cdot (y_w - 1) + 4 = \frac{3}{2}y_w - \frac{3}{2} + 4 = \frac{3}{2}y_w + \frac{5}{2}$
  • $z_{vp} = \frac{6}{5} \cdot (z_w - 1) + 2 = \frac{6}{5}z_w - \frac{6}{5} + 2 = \frac{6}{5}z_w + \frac{4}{5}$

3. Construct the Transformation Matrix

The transformation can be represented using homogeneous coordinates and a 4x4 matrix. The derived equations correspond to the following matrix:

$ M = \begin{bmatrix} Sx & 0 & 0 & Tx \\ 0 & Sy & 0 & Ty \\ 0 & 0 & Sz & Tz \\ 0 & 0 & 0 & 1 \end{bmatrix} $

Where:

  • $Tx = -Sx \cdot x_{w_{min}} + x_{vp_{min}} = -2 \cdot 1 + 2 = 0$
  • $Ty = -Sy \cdot y_{w_{min}} + y_{vp_{min}} = -\frac{3}{2} \cdot 1 + 4 = \frac{5}{2}$
  • $Tz = -Sz \cdot z_{w_{min}} + z_{vp_{min}} = -\frac{6}{5} \cdot 1 + 2 = \frac{4}{5}$

Therefore, the final normalized matrix is:

$ \begin{bmatrix} 2 & 0 & 0 & 0 \\ 0 & \frac{3}{2} & 0 & \frac{5}{2} \\ 0 & 0 & \frac{6}{5} & \frac{4}{5} \\ 0 & 0 & 0 & 1 \end{bmatrix} $

This matches Option A.

Was this answer helpful?

Important Questions from Three Dimensional Concepts

  1. K-mean clustering algorithm has clustered the given 8 observations into 3 clusters after 1st iteration as follows:

    C1 : {(3,3), (5,5), (7,7)}

    C2 : {(0,6), (6,0), (3,0)}

    C3 : {(8,8),(4,4)}

    What will be the Manhattan distance for observation (4,4) from cluster centroid C1 in second iteration?

  2. In the context of 3D computer graphics, which of the following statements is/are TRUE?

    P: Orthographic transformations keep parallel lines parallel

    Q: Orthographic transformations are affine transformations

    Select the correct answer from the options given below:
  3. Given below are different properties of 3D projections from A-D. Identify the correct order on the basis of property true of (i) a perspective projection only, (ii) an orthographic projection only, (iii) both orthographic and projective transformations and (iv) neither orthographic nor projective transformation, respectively.

    (A) Straight lines are mapped to straight lines.

    (B) Distances and angles are (in general) preserved.

    (C) Far away objects appear the same size as closer ones

    (D) Requires homogeneous coordinates in order for it to be encoded into a linear transformation.

    Choose the correct answer from the options given below:

  4. Concerning phong shading and Gouraud shading in a 3D scene, which of the following statements are true ?

    (A) Gouraud shading requires more computation than phong shading.

    (B) Gouraud shading linearly interpolates the color of an interior pixel from the color at the vertices

    (C) Phong shading interpolates over the normal vectors specified at the vertices.

    Choose the correct answer from the options given below:

  5. In the context of 3D Computer graphics, which of the following statements is/are correct?

    (A) Under perspective projection, each set of parallel lines in the object do not stay parallel in the image (except those that are parallel to the viewplane to start with).

    (B) Applying a perspective transformation in the graphics pipeline to a vertex involves dividing by its 'z' coordinate.

    (C) Perspective transformation is a linear transformation.

    Choose the correct answer from the options given below:

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App