 Hello friends, myself, Darshan Pandit, assistant professor, Department of Computer Science and Engineering from Valtran Institute of Technology, Solapur. So today we are going to see about window to viewport transformation. So at the end of this session, student will be able to map window coordinate and viewport coordinate. So here we are going to see what is world coordinate, normalized coordinate and how window coordinate are mapped to viewport coordinate. So world coordinate, so you can see this picture from a world coordinate space. So the picture storage uses convenient Cartesian coordinate system referred as world coordinate system where the display device uses physical device coordinate system and we require to map world coordinate to this display device coordinate in order to display image on your screen. So this requires normalized coordinate. So we are having problem in mapping world coordinate image to screen coordinate because of display device as different display device have different screen size and also resolution varies. So when we map a picture on low resolution screen, the image get distorted and when picture is mapped on high resolution screen then we get smaller image. So to eliminate this problem, we require normalized coordinate. So we define a picture coordinate in some unit other than pixels and we also use interpolator to convert coordinate to appropriate pixel values for a particular device. So these device independent units are known as normalized coordinate. So in normalized coordinate, the screen measures one unit wide and one unit in length. So you can see this picture definition in normalized device coordinate. So once picture is mapped to normalized device coordinate, after that we are mapping this to screen that is to viewport. So you can see this image from world space. So this image is mapped to normalized device coordinate after that from here it is mapped on to the device that is to your screen. So that the image is not distorted or the image size is not decreased. So normalized device coordinate uses interpretum which consists of simple linear formula to convert normalized device coordinate to actual device coordinate where x equal to xn into xw y equal to yn into yh. So x and y are coordinates of actual device xn and yn are normalized x and y coordinate, xw is width of actual screen in pixel and yh is height of actual screen in pixel. So the transformation which maps world coordinate to the normalized device coordinate is called normalization transformation. So how window coordinate are mapped to viewport that is window to viewport transformation. So here window is nothing but selecting a finite area from world coordinate for display and viewport is an area on device to which window is mapped. So that is what is to be viewed is nothing but window and where it is to be displayed that is where the image to be displayed is defined by viewport. So window from world coordinate so it is mapped to normalized device coordinate from here it is mapped to viewport coordinate that is your screen coordinate. So window to viewport coordinate transformation is nothing but window transformation or work station transformation y axis, x axis and this figure shows image from window and this much part we are selecting which is to be displayed on viewport. So yw min, yw max which are min max coordinate of window xw min, xw max that is min max x coordinate of window. So this is mapped to the viewport that is on your screen coordinate with xw min, xw max that is min max coordinate of viewport, yb min, yb max, y coordinate of viewport. So this is the procedure how we map window to viewport. So we use interpretum to maintain same relative placement in the viewport as in window we require to calculate xv and yv. So xv minus xv min by xv max minus xv min equal to xw minus xw min by xw max minus xw min ok. So this is equation 1 which gives you xw and equation 2 gives you yb where yb minus yb min by yb max minus yb min equal to yw minus yw min by yw max minus yw min. This gives you equation 2 that is value of yb. So by solving equation 1, a and b we get viewport position xv and yb as xv equal to xv min plus xw minus xw min into sx and yb equal to yb min plus yw minus yw min into sy. So here sx and sy are the scaling factor where sx equal to xw max minus xw min by xw max minus xw min and sy is sv max minus sv min sw max minus xw min. So young scaling factor are used to convert a sequence of transformation that is using a fixed point position xw min comma xw min and yw min that scales the window area to the size of viewport that is translate the scaled window area to the position of viewport. And this relative proportion of objects are maintained if scaling factors are same that is sx equal to sy that is from normalized coordinate the object description are mapped to various display device. So that is why we require them scaling factor sx and sy so think and write so here you need to pause the video and answer the question that is differentiate between window and viewport coordinate. So window coordinate and viewport coordinate so the area selected from world coordinate space for display is called window and an area on display device to which window is marked is called viewport and a window defines a rectangular area in world coordinate and in viewport defines in a normalized coordinate a rectangular area on a display device where image of data appears. So third point in computer graphics a window is a graphical control element and a viewport is a polygon viewing region in a computer graphics. So these are the references which are used to create this video thank you.