When we model an image in World Device Coordinates (WDC) we are not interested in the entire world but only a portion of it. Therefore we define the portion of interest which is a polygonal area specified in world coordinates, called the "window".
|Example: Want to plot x vs. cos(x) for x between 0.0 and 2Pi. Now cos x will be between -1.0 and +1.0. So we want the window as shown here.|
The command to set a window is Set_window2( Xwmin, Xwmax, Ywmin, Ywmax ). So for plot above use the following command:
Set_window2(0, 6.28, -1.0, +1.0 )
We can use the window to change the apparent size and/or location of objects in the image. Changing the window affects all of the objects in the image. These effects are called "Zooming" and "Panning".
Assume you are drawing a house:
|Now increase the window size and the house appears
smaller, i.e., you have zoomed out:
Set_window( -60, +60, -30, +30 )
|If you decrease the window size the house appears
larger, i.e., you have zoomed in:
Set_window( -21, +21, -11, +11 )
So we can change the apparent size of an image, in this case a house, by changing the window size.
What about the position of the image?
|A. Set_window(-40, +20,-15,+15)
Moving all objects in the scene by changing the window is called "panning".
Last changed September 30, 1998, G. Scott Owen, email@example.com