Computer Graphics Window

The process of selecting and viewing an image with different views, called windowing.

All the objects in the real world have a size. We can measure the size and location of an object by the unit.

For Example-We use the meter unit to measure both size and the location of the object.  

When we represent the image of an object on the screen, then we use the screen coordinate system. The screen coordinate system is used to define the location of the object. When we select the screen coordinate system, then the image can be displayed on the screen.

“The Capability to show some part of an object in a window is known as windowing.”

“The rectangular area describes in the world coordinate system is called the window.”

Viewport:

“The viewport can be defined as an area on the screen which is used to display the object.” The window is an area space for the object. Viewport surrounds the object. We need the coordinate transformation to display the object on the screen. We can define many viewports on a different area of the screen and also see the same object from a different angle in the viewport.

Window to Viewport transformation:

“Window to viewport transformation is a process of converting two-dimensional or world into a device coordinate.”

The object inside the clipping window is mapped to the viewport. The viewport is displayed inside the interface window on the screen. We can use the clipping window to select the part of an object, and the viewport is used to display the selected part of the object on the screen or output device.

Computer Graphics Window
  • Steps for Window to Viewport Transformation: We can follow the following steps for transform window to viewport:

Step 1: Translation of the window towards the Origin- If we shift the window towards the origin, the upper left, and the lower-left corner of the window will be negative (-). The translation factor also should be negative (-).

Step 2: Resize the window to viewport size- To Convert the size of the window into the size of the viewport, we will use the following formulas:

 Sx =   XVmax XVmin / XWmax XWmin

 Sy =   YVmax YVmin / YWmax YWmin

Step 3: Translation of window (Position of window and viewport must be same)- If the lower-left corner of viewport is (0, 0), then the window lower-left corner is already shifted on origin after following step 1.

If the lower-left corner is not equal to (0, 0), then the translation factor should be positive (+).

Computer Graphics Window2

It may be possible that sometimes the size of viewport is greater or smaller than the window. In that situation, we have to enlarge or compress the size of the window according to the viewport. We can perform it using some mathematical calculations.

A point on window = (XW, YW)

Corresponding point on viewport = (XV, YV)

  • To calculate (XV, YV)

Normalized point on window = (XW- XWmin / XWmax - XWmin)

                                                    (YW- YWmin / YWmax - YWmin)

Normalized point on viewport = (XV- XVmin / XVmax - XVmin)

                                                     (YV- YVmin / YVmax - YVmin)

  • Now, the position of object in viewport and window are same-

For Coordinate x:

(XW- XWmin / XWmax - XWmin) = (XV- XVmin / XVmax - XVmin)

For Coordinate y:

(YW- YWmin / YWmax - YWmin) = (YV- YVmin / YVmax - YVmin)

Now, we get

XV = XVmin + (XW- XW­min) Sx

YV = YVmin + (YW- YW­min) Sy

Here Sx and Sy are the scaling factor for x and y coordinate.

  Sx =   XVmax XVmin / XWmax XWmin

 Sy =   YVmax YVmin / YWmax YWmin

Some Important Points:

  1. We can select the world coordinate system according to the application program.
  2. We can select the screen coordinate system according to the desired design.
  3. Viewing transformation is a connection between the world and the screen coordinates.

Advantages:

We can easily represent images on the display screen according to the user’s needs.


Related Topics

Anti-aliasing in Computer Graphics

Anti-aliasing in Computer Graphics “Anti-aliasing is a method for eliminating the aliasing effect used in computer graphics. In a 2-dimensional object, the ambient occlusion impact is the existence of sharp edges...

7 minutes read.

Point Clipping

“Point clipping is a process which is used to define the point position.” The point is either inside the view pane (window) or outside the view pane. In computer graphics, the computer...

2 minutes read.

Types of Computer Graphics

Types of Computer Graphics The computer graphics contains two types. They are- Raster (Bitmap) graphicsVector graphics Many individuals are likely to consider pictures on computers (or phones, tablets, or some other electronic gadget...

5 minutes read.

Output Devices in Computer Graphics

Computer Graphics Output Devices An output device is a component of hardware or the main physical part of a computer that can be touched and seen. An output device is an electromechanical device. “The...

5 minutes read.

Filled Area Primitives Computer Graphics

Filled Area Primitives: Area filling is a method or process that helps us to fill an object, area, or image. We can easily fill the polygon. The polygon filling is...

4 minutes read.

Illumination Model in Computer Graphics

Illumination Model in Computer Graphics The series of methods used to depict light in computer graphics scenarios is computer graphics illumination. Although lighting strategies provide versatility in the degree of detail...

8 minutes read.

2D Rotation

The Rotation of any object depends upon the two points. Rotation Point: It is also called the Pivot point. Rotation Angle: It is denoted by Theta (). We can rotate an object in...

1 minute read.

Pointing and Positioning Technique Computer Graphics

Pointing and Positioning Technique: The pointing and positioning are interactions used in computer graphics. A pointing device is also called a Pointing tool. A pointing tool is a hardware component,...

4 minutes read.

2D Scaling

In scaling, we can expend or compress the size of any object. We can apply scaling on the object by multiplying the original coordinates with scaling factors. The term scaling factor...

2 minutes read.

Composite Transformation in Computer Graphics

Composite transformation in Computer Graphics It is possible to integrate a range of transformations or series of transformations into some kind of a single one which is known as composition. The...

6 minutes read.

Applications of Computer Graphics

Applications of Computer Graphics Some applications of computer graphics are mentioned below- Graphical User Interface (GUI): It is a way of interacting with a computer using the icon, ...

2 minutes read.

Midpoint Circle Drawing Algorithm in Computer Graphics

The midpoint circle drawing algorithm helps us to calculate the complete perimeter points of a circle for the first octant. We can quickly find and calculate the points of other...

12 minutes read.

Aspect Ratio in Computer Graphics

Aspect Ratio in Computer Graphics You might well understand the concept of Aspect ratio as of now if you know regarding aerial photography or see the configuration portion of any computer...

5 minutes read.

Scan Conversion in Computer Graphics

“When we represent regular objects in the form of discrete pixels, it is called Scan Conversion.” Every graphics system must transform the primitives into a collection of pixels. The scan conversion is also...

2 minutes read.

Display Devices in Computer Graphics

The display device is an output device used to represent the information in the form of images (visual form). Display systems are mostly called a video monitor or Video display unit (VDU). Display devices are designed to model, display, view, or display information. The...

6 minutes read.

Animation in Computer Graphics

The word Animation is extracted from a Latin language, "Anima," which means "Soul." TheAnimation is a technology that allows any image object, an entity to walk, talk, or do some...

3 minutes read.

Input Devices in Computer Graphics

An Input device is the piece of computer hardware equipment used to give input to the computer. The input can be in the form of graphics, text, sound, audio, video,...

7 minutes read.

Display Processor

It is a part of hardware or interpreter which is used to transform display processor code into pictures. It is used to convert digital information from CPU to analog data. It...

4 minutes read.

Zooming

In computer graphics, the term “Zoom is referred as a function, focuses on a particular portion or part of an image and also enlarging the image’s size for greater details.” In windows...

2 minutes read.

2D Translation

We can move any object from one to another place without changing the shape of the object. For Example- Translation of a Point:If we want to translate a point from P (x0,...

1 minute read.