0% found this document useful (0 votes)
37 views

2. Clipping Notes

Uploaded by

tembomadalitso02
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

2. Clipping Notes

Uploaded by

tembomadalitso02
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Clipping

Clipping
• Clipping in computer graphics refers to the
process of determining which parts of a
graphic object should be displayed on a screen
or a viewport.
Clipping
• When an object is rendered in computer
graphics, it is typically defined by a set of
vertices and edges that make up its shape.
• However, these vertices and edges may
extend beyond the boundaries of the screen
or viewport.
Clipping
• Clipping algorithms are used to determine
which portions of the object should be visible
on the screen or viewport, and which portions
should be removed or "clipped" from view.
• This can be done using various techniques,
such as the Cohen-Sutherland algorithm, the
Liang-Barsky algorithm, or the Sutherland-
Hodgman algorithm.
Clipping
• In general, clipping algorithms work by dividing
the screen or viewport into smaller regions, and
testing each vertex of the object against these
regions.
• If a vertex is found to be outside the region, it is
either discarded or replaced with a new vertex
that lies on the boundary of the region.
• This process is repeated for each edge of the
object, until the final visible portion of the object
is determined.
Clipping
• Overall, clipping is an essential step in the
rendering pipeline of computer graphics, as it
ensures that only the necessary portions of an
object are displayed on the screen or
viewport, thereby improving performance and
reducing unnecessary processing.
Window Viewport
• In computer graphics, the terms "viewport" and
"window" are often used to refer to two different
concepts related to the display of graphical content.
• A window is a rectangular area on the screen that
contains the graphical content of an application. It can
be resized, minimized, and moved around on the
screen. In other words, a window is a region of the
screen where a user interface is displayed, and it can
contain one or more viewports.
• A viewport, on the other hand, is a rectangular region
within a window where a particular portion of the
graphical content is displayed.
Window Viewport
• It is essentially a subset of the window, and can be
moved and resized within the window.
• Viewports are commonly used in 3D graphics to display
a portion of a 3D scene, or in 2D graphics to display a
zoomed-in or cropped portion of an image.
• To summarize, a window is a container for the
graphical content of an application, while a viewport is
a subset of that content that is displayed within the
window.
• In other words, a window can contain one or more
viewports, depending on the requirements of the
application.
Window Viewport Application
• One example of an application that uses viewports and windows is a 3D
modeling software. In this software, the main window would contain the
user interface elements, such as menus, toolbars, and dialog boxes, while
the viewports would display different perspectives of the 3D model being
created.
• For example, the user may have one viewport displaying the model from a
top-down view, another viewport displaying the model from a side view,
and a third viewport displaying a close-up of a particular part of the
model. The user can then interact with the model using various tools and
commands provided by the software, while seeing the effects of their
actions in real-time within the viewports.
• The ability to have multiple viewports allows the user to work with the 3D
model from different angles and perspectives, making it easier to create
complex designs and visualizations. Additionally, the ability to resize and
move the viewports within the main window allows the user to customize
their workspace to their preferences and workflow.
Polygon Clipping

You might also like