0
1.4kviews
Window to view port coordinate transformation mapping.

Mumbai University > mechanical engineering > Sem 7 > CAD/CAM/CAE

Marks: 8 Marks

Year: May 2016

1 Answer
1
7views
  • A world coordinate area selected for display is called a window. An area on a display device to which a window is mapped is called a viewport. The window defines what is to be viewed; the viewport defines where it is to be displayed.
  • Window-to-Viewport mapping is the process of mapping or transforming a two-dimensional, world-coordinate scene to device coordinates. In particular, objects inside the world or clipping window are mapped to the viewport. The viewport is displayed in the interface window on the screen. In other words, the clipping window is used to select the part of the scene that is to be displayed. The viewport then positions the scene on the output device.

enter image description here

  • This mapping or transformation involves developing formulas that start with a point in the world window, say (xw, yw). The formula is used to produce a corresponding point in viewport coordinates, say (xv, yv). We would like for this mapping to be "proportional" in the sense that if xw is 30% of the way from the left edge of the world window, then xv is 30% of the way from the left edge of the viewport. Similarly, if yw is 30% of the way from the bottom edge of the world window, then yv is 30% of the way from the bottom edge of the viewport. The picture below shows this proportionality.

  • Using this proportionality, the following ratios must be equal.

    $\dfrac{xv-xv_{\min}}{xv_{\max}-xv_{\min}} = \dfrac{xw-xw_{\min}}{xw_{\max}-xw_{\min}} \\ \dfrac{yv-yv_{\min}}{yv_{\max}-yv_{\min}} = \dfrac{yw-yw_{\min}}{yw_{\max}-yw_{\min}} \\ \text{The translation factors (Tx, Ty) would be:} \\ t_x=\dfrac{xw_{\max}xv_{\min}-xw_{\min}xv_{\max}}{xw_{\max}xw_{\min}} \\ t_y=\dfrac{yw_{\max}yv_{\min}-yw_{\min}yv_{\max}}{yw_{\max}yw_{\min}}$

  • The position of the viewport can be changed allowing objects to be viewed at different positions on the Interface Window. Multiple viewports can also be used to display different sections of a scene at different screen positions. Also, by changing the dimensions of the viewport, the size and proportions of the objects being displayed can be manipulated. Thus, a zooming affect can be achieved by successively mapping different dimensioned clipping windows on a fixed sized viewport.

  • If the aspect ratio of the world window and the viewport are different, then the image may look distorted.
Please log in to add an answer.