Window-To-Viewport Coordinate Transformation

Once object descriptions have been transferred to the viewing reference frame, we choose the window extents in viewing coordinates and select the viewport limits in normalized coordinates . Object descriptions are then transferred to normalized device coordinates. We do this using a transformation that maintains the same relative placement of objects in normalized space as they had in viewing coordinates. If a coordinate position is at the center of the viewing window, for instance, it will be displayed at the center of the viewport.

Figure (a) illustrates the window-to-viewport mapping. A point at position (xw, yw) in the window is mapped into position (xv, yv) in the associated view-port. To maintain the same relative placement in the viewport as in the window, we require that




Firgure (a)


Figure (b) A point at position (xm, yw) in a designated window is mapped to viewport coordinates (xv, yv) so that relative positions in the two areas are the same.

Solving these expressions for the viewport position (xv, yv), we have

xv = xvmin + (xw – xwmin)sx

yv = yvmin + (yw - ywmin)sy

where the scaling factors are


Equations  can also be derived with a set of transformtions that converts the window area into the viewport area. This conversion is performed with the following sequence of transformations:

1. Perform a scaling transformation using a fixed-point position of (xwmin, ywmin) that scales the window area to the size of the viewport.

2. Translate the scaled window area to the position of the viewport.

Relative proportions of objects are maintained if the scaling factors are the me (sx = sy). Otherwise, world objects will .be stretched or contracted in either e x or y direction when displayed on the output device.

Character strings can be handled in two ways when they are mapped to a viewport. The simplest mapping maintains a constant character size, even though the viewport area may be enlarged or reduced relative to the window. This method would be employed when text is formed with standard character fonts  that cannot be changed. In systems that allow .for changes in character size, string definitions can be windowed the same as other primitives. For characters formed with line segments, the mapping to the viewport can be carried out as a sequence of line transformations.

From normalized coordinates, object descriptions are mapped to the viewport display devices. Any number of output devices can be open in a particular application, and another window-to-viewport transformation can be performed for each open output device. This mapping, called the workstation transformation, is accomplished by selecting a window area in normalized space and a viewport area in the coordinates of the display device. With the workstation transformation, we gain some additional control over the positioning of parts of  a scene on individual output devices. As illustrated in Fig. (b), we can use work station transformations to partition a view so that different parts of normalized space can be displayed on different output devices.



Figure (b)


Figure (b) Mapping selected parts of a scene in normalized coordinated to different video monitors with workstation transformations.

Exterior Clipping

So far, we have considered only procedures for clipping a picture to the interior of a region by eliminating everything outside the clipping region. What is saved by these procedures is inside the region. In some cases, we want to do the reverse, that is, we want to clip a picture to the exterior of a specified region. The picture parts to be saved are those that are outside the region. This is referred to as exterior clipping.

A typical example of the application of exterior clipping is in multiple-window systems. To correctly display the screen windows, we often need to apply both internal and external clipping. Figure 6-31 illustrates a multiple-window display. Objects within a window are clipped to the interior of that window. When other higher-priority windows overlap these objects, the objects are also clipped to the exterior of the overlapping windows.

Exterior clipping is used also in other applications that require overlapping pictures. Examples here include the design of page layouts in advertising or publishing applications or for adding labels or design patterns to a picture. The technique can also be used for combining graphs, maps, or schematics. For these applications, we can use exterior clipping to provide a space for an insert into a larger picture.

Procedures for clipping objects to the interior of concave polygon windows can also make use of external clipping. A line P,P, that is to be clipped to the interior of a concave window with vertices V1V2V3V4V5. Line P, P2 can be clipped in two passes: (1) First, P]P1 is clipped to the interior of the convex polygon ViV,V3V, o yield the clipped segment P'iP':)  (2) Then an external clip of P'iP'z is performed against the convex polygon V,V,V, to yield the final clipped line segment P'i'2.



Figure (c): A multiple-window screen display showing examples of both interior and exterior clipping.



Like it on Facebook, +1 on Google, Tweet it or share this article on other bookmarking websites.

Written by
Lohit Seth
Saari umar hum Mar mar ke jee liye Ek pal to ab humein jeene do Jeene do Saari umar hum Mar mar ke jee liye Ek pal to ab humein jeene do Jeene do Saari umar hum Mar mar ke jee liye Ek pal to ab humein jeene do Jeene do Na na na….Na na na….Na na na….Na na nana na…. Give me some sunshine Give me some rain Give me another chance I wanna grow up once again Give me some sunshine Give me some rain Give me another chance I wanna grow up once again Kandhon ko kitabon Ke bojh ne jhukaya Rishvat dena to khud Papa ne sikhaya 99% marks laaoge to ghadi, varna chhadi Likh likh kar pada hatheli par Alpha, beta, gamma ka chaala Concentrated H2SO4 ne poora Poora bachpan jalaa daala Bachpan to gaya Jawani bhi gayi Ek pal to ab humein Jeene do jeene do Bachpan to gaya Jawani bhi gayi Ek pal to ab humein Jeene do jeene do Saari umar hum Mar mar ke jee liye Ek pal to ab humein jeene do Jeene do Na na na….Na na na….Na na na….Na na nana na….
  • No comments found

Latest Articles

In this article, you shall learn how to withdraw your money from your PayPal account. To withdraw your money, the first thing you need to do is ‘Login’
Humans are social being and we need to interact with people. A friend plays an important role in one's life. Sometimes, we face loneliness and feel like
Donald Trump won the election but lost the popular vote. This is the dichotomy of the American election where it is not the case of first past the post.

Related Articles

Introduction  People generally want to satisfy their interests in various ways. They often lack scientific understanding as to their ways selected
Pet dogs and street dogs  There are two types of dogs, one is which we control at home and we call them pet dogs and the other is which we don’t
In the first instance you have to remember that in this country of ours where cow slaughter is so much discussed and where milk is respected, the cows
Many people love to have pet at their home. Some like to have dogs and some like to have fish tank at their home. Different people have different choices
Have you ever thought why ancient or prehistoric animals were so enormous and huge than today? Ancient animals like Sauropods,the biggest Dinosaur ever