## 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**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.
This

**transformation**involved developing formula then start with a point in the world window (X_{w}, Y_{w}) b a board like for this method to be propositional. In the scene if X_{w}is 30% of the way from the left then Xv is also 30% of the way from the bottom in the**viewport**. Similarly, Y_{w}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 (X_{v},Y_{v}) the following becomes true.
\[X_{v} = S_{x} X_{w} + t_{x}\] &

\[Y_{v} = S_{y} Y_{w} + t_{y}\]

Where S

Where S

_{x},S_{y}is a scale vectors and t_{x}, t_{y}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?

**Next Topic : 3D Transformation**