You are on page 1of 1

Two dimensional viewing Window: a world coordinate area selected for display is called is called a window.

The window defined what is defined what is to be viewed. View port: an area on a display device to which a window is mapped is called a view port. It define where the picture is to displayed. The mapping of a part of world co ordinate scene to device co-ordinate is refers to as viewing transformation. Yw max

(Xw,yw)

#clipping: When shutter land line clipping algorithem. 1001 1000 1010 y=ywmax 0001 0000 0010 y=ywmin 0101 0100 0110 X=xwmin x=xw max Region code has four bit 4321 ABRL 1 0 1 0 bits ABRL #First method End pt region code: Compare point co ordinate clip boundaries. Eg. X< xw min--- set bit 1 to 1 #2nd method: Calculate the different between the endpoint co-ordinate of the clip boundaries. -use the sign bit of each differing calculating of set corresponding which the region code -value of bit 1 is signbit of x-xwmin and so on.

ywmin xwmin xwmax The above fig. ellustrate window to view port mapping. A point at position (xw,yw) in the window is mapped into position (xv,yv) in associated viewport to maintain the same relative placement in the viewport as in the window, we require that xX x min = xw xw min xv max- xv min xwmax- xw min (A) yw-yw min = yw- yw min

yw max-yw min min (B)

ywmax- yw

from A and B, we get xv-xvmin=(xwxwmin) * xvmax xvmin = (xwxwmin)sx xwmax-xwmin Xwmax - xwmin Similarly, yv= yvmin+(yw-ymin)sy when scaling factor Sy = ywmax-yvmin ywmax-ywmin Xv=xvmin+(xw-xwmin)sx Where scaling factor sx = xv maxxv min

You might also like