Tuesday, July 2, 2019

Window to viewport transformation


Window to viewport transformation

Window

A window coordinate area selected for display is called a window. In computer graphics a window is a graphically control element. It consists of a visual area containing some of the GUI of the program it belongs and its framed by a window decoration.

Viewport

An area on a display device to that a window is mapped is named a viewport.

• A viewport Is a polygon view reason in computer graphics.

• A viewport defines in normalize coordinates a rectangular Area on a display device where the image of data appears.  Window to viewport transformation is the process of transforming a 2D word co-ordinate scene to device co-ordinate. In particular object inside the world of clipping window are mapped the viewport in other word the clipping window is used to select the port of the seen that is to be display.

Window to viewport transformation

This transformation involved developing formula then start with a point in the world window (Xw, Yw) b a board like for this method to be propositional. In the scene if Xw is 30% of the way from the left then Xv is also 30% of the way from the bottom in the viewport. Similarly, Yw is 30% of the way from the bottom is then why we is also 30% of the way from the bottom in the viewport. using this propositionally the following ratio must be equal.

  &


By solving these equations for the viewport position (Xv,Yv) the following becomes true.
\[X_{v} = S_{x} X_{w} + t_{x}\] &
\[Y_{v} = S_{y} Y_{w} + t_{y}\]
Where Sx,Sy is a scale vectors and tx, ty is a translation factors.
\[S_{x} = \frac{(Xvmax-Xvmin)}{(Xwmax-Xwmin)}\]
\[S_{y} = \frac{(Yvmax-Yvmin)}{(Ywmax-Ywmin)}\]


AND 

\[t_{x} = \frac{(Xwmax Xvmin-Xwmin Xvmax)}{(Xwmax-Xwmin)}\]

\[t_{y} = \frac{(Ywmax Yvmin-Ywmin Yvmax)}{(Ywmax-Ywmin)}\]



Multiple viewport can also be used to display sections of a seen at different screen position.




Related Questions :

What is window to viewport transformation?
What is window and viewport?
What is window and viewport in graphics?
What is windowing transformation?