SlideShare a Scribd company logo
1 of 16
Group 6 Presentation
Name
Takudzwa Mutambu
Ngonidzashe Mwendera
Gerald Matanhire
Devotion Masikati
Tapiwanashe Gwena
Shamiso Khumbula
Kelvin Dube
Assani Saidi
Reg Number
R192975T
R197295X
R1912448M
R1915853W
R1912331Z
R1913840M
R175251T
R194565B
Introduction
• The line clipping is a process in which we can cut the part of the line,
which lies outside the view pane. Only those lines are visible, which lie
inside the view pane.
• The Cohen-Sutherland line clipping algorithm is a common method
used in computer graphics to efficiently clip lines against a rectangular
clipping window. Line clipping is an important task in computer
graphics because it allows us to selectively display only the portions of
a line that are visible within a given viewport or window while
discarding the portions that lie outside of it. This can improve the
overall performance and visual quality of a graphics application,
particularly when rendering complex scenes.
• In this presentation, we will introduce the Cohen-Sutherland line
clipping algorithm, explain how it works, demonstrate its use with an
example, discuss its advantages and limitations.
Cohen-Sutherland Line Clipping
Algorithm
View Plane
How the algorithm works
• We will divide the view pane into nine equal segments that only serve the
viewport.
• We will represent the top, bottom, left, and right corner of the window with
4 bits. These 4 bits can be described with the following point:
• If an object lies within any particular corner position, that corner value will
be 1, else it will be 0.
• The allocation of bits depends on “TBRL” (Top, Bottom, Right, Left) rule.
• Suppose, if the point of a line appears in the top-left corner, then according
to TBRL, the value is 1001. We will allot the bits as-
• For the top corner, because the object is present at the top corner.
• For the bottom corner, because the object does not lie at the bottom.
• For the right corner, because the object does not lie at the right side.
• For the left corner, because the object lies at the top-left corner.
• In this way, we check TBRL for each segment and allot the bits accordingly.
Illustration of the TBRL rule
Line Viewing
• In Cohen- Sutherland Algorithm we will divide the lines into
following Sections
• Visible Line: When both points (starting and ending) of the
line are entirely situated inside the window.
• Invisible Line: When both points (Starting and ending) of
the line are completely situated outside the window.
• Clipped Line: Everyline has two endpoints. Let (x0, y0) and
(x1, y1) are points of the line. If one point of the line situated
inside the window and the other one is outside the
window, then the line is known as Clipped Line.
Steps when using the Algorithm
1.Determine the region codes for the endpoints of
the line.
2.Check if both endpoints are within the clipping
window (region code = 0000). If they are, the
line is completely inside the window and can be
displayed.
3.If both endpoints have a region code that has a
common bit value of 1, the line is completely
outside the clipping window and can be rejected.
Step 4
• If the line is partially inside the clipping window, perform line
clipping using the following steps:
• a. Find the intersection of the line with the clipping window
boundaries.
• b. If an endpoint lies outside the clipping window, replace it
with the intersection point.
• c. Recalculate the region codes for the new endpoints.
• d. Repeat steps b and c until both endpoints lie within the
clipping window or the line is completely outside.
Example
In the below-mentioned example, we have
different lines. The different category of the line
Example
• Line AB is a clipped case.
• The line CD is completely visible.
• Line EF is completely invisible.
• Line GH is a clipped case.
• Line KL is completely invisible.
• Line IJ is a clipped case.
Endpoints of the Lines
• The endpoints of lines are lies as follow
• A ? 0000
• B ? 1010
• C ? 0000
• D ? 0000
• E ? 0100
• F ? 0100
• G ? 0001
• H ? 0000
• I ? 0000
• J ? 0010
• K ? 1000
• L ? 1000
Applications of the Algorithm
1. Line Clipping in Computer Graphics: The primary application
of the Cohen-Sutherland algorithm is in line clipping for
rendering graphics. It efficiently determines which portions of
a line lie inside or outside a given clipping window, allowing
for the rendering of only the visible parts of the line. This helps
optimize the rendering process and improve the overall
efficiency of graphics systems.
2. Window and Viewport Clipping: The Cohen-Sutherland
algorithm can be used for window and viewport clipping in
graphical user interfaces (GUIs). It determines which portions
of a window or viewport lie within the visible area, ensuring
that only the visible content is displayed. This is particularly
useful when working with large documents or images that
need to be displayed within a limited viewing area.
Applications
1. Line Clipping in CAD Systems: Computer-aided design (CAD)
systems often make use of the Cohen-Sutherland algorithm
for line clipping operations. It enables the efficient
manipulation and display of lines and geometries within the
CAD environment. The algorithm ensures that only the visible
portions of lines are displayed, allowing designers and
engineers to work with accurate and visually appealing
representations.
2. Image Processing and Digital Photography: In image
processing and digital photography applications, the Cohen-
Sutherland algorithm can be utilized for cropping or trimming
images. It allows for the precise selection of regions of
interest and removal of unwanted portions, resulting in
improved composition and visual aesthetics.
Advantages of the algorithm
• Ability to handle arbitrary clipping windows: The algorithm can handle
clipping windows of any shape, not just rectangular ones. This makes it
more flexible and versatile than other clipping algorithms that are
limited to rectangular windows.
• Efficiency in handling many different types of lines: The algorithm is
efficient in handling many different types of lines, including vertical,
horizontal, and diagonal lines. It can also handle lines of any slope,
including those that are steep or nearly horizontal.
• Easy to implement: The algorithm is relatively easy to implement and
can be adapted to a variety of programming languages and
environments.
Limitations
• Inability to handle curved lines: The algorithm is not capable of
handling curved lines, which can be a significant limitation in some
cases. Other algorithms, such as the Cyrus-Beck algorithm, can handle
curved lines but may not be as efficient as the Cohen-Sutherland
algorithm.
• Limited to line clipping: The Cohen-Sutherland algorithm is designed
specifically for line clipping and cannot be used for other types of
clipping, such as polygon clipping.
• Requires pre-processing: The algorithm requires pre-processing to
compute the two-bit codes for each point or line segment, which can
add some overhead to the overall clipping process.

More Related Content

Similar to Group 5 Presentation.pptx

Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh Panchal
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clippingavelraj
 
Cohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmCohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmTawfiq Ahmed
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfAmol Gaikwad
 
Hidden line removal algorithm
Hidden line removal algorithmHidden line removal algorithm
Hidden line removal algorithmKKARUNKARTHIK
 
final Unit 1-1.pdf
final Unit 1-1.pdffinal Unit 1-1.pdf
final Unit 1-1.pdfprakashvs7
 
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdfUNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdfVivekKumar148171
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpgaHossam Hassan
 
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmPolygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmMani Kanth
 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsRohit Jain
 
Auto cad ppt
Auto cad pptAuto cad ppt
Auto cad ppthrprt7696
 
Two marks with answers ME6501 CAD
Two marks with answers ME6501 CADTwo marks with answers ME6501 CAD
Two marks with answers ME6501 CADPriscilla CPG
 

Similar to Group 5 Presentation.pptx (20)

Bhavesh window clipping slidshare
Bhavesh window clipping slidshareBhavesh window clipping slidshare
Bhavesh window clipping slidshare
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
 
Cohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithmCohen sutherland line clipping algorithm
Cohen sutherland line clipping algorithm
 
kgv.pptx
kgv.pptxkgv.pptx
kgv.pptx
 
CAD
CAD CAD
CAD
 
lecture8 clipping
lecture8 clippinglecture8 clipping
lecture8 clipping
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdf
 
Hidden line removal algorithm
Hidden line removal algorithmHidden line removal algorithm
Hidden line removal algorithm
 
AUTOCAD SOFTWAE ppt
AUTOCAD  SOFTWAE pptAUTOCAD  SOFTWAE ppt
AUTOCAD SOFTWAE ppt
 
final Unit 1-1.pdf
final Unit 1-1.pdffinal Unit 1-1.pdf
final Unit 1-1.pdf
 
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdfUNIT_3-Two-Dimensional-Geometric-Transformations.pdf
UNIT_3-Two-Dimensional-Geometric-Transformations.pdf
 
Dot matrix display design using fpga
Dot matrix display design using fpgaDot matrix display design using fpga
Dot matrix display design using fpga
 
Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )
 
ibuib.pptx
ibuib.pptxibuib.pptx
ibuib.pptx
 
Digital design of maxillary of rpd's
Digital design of maxillary of rpd'sDigital design of maxillary of rpd's
Digital design of maxillary of rpd's
 
Clipping
ClippingClipping
Clipping
 
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmPolygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithms
 
Auto cad ppt
Auto cad pptAuto cad ppt
Auto cad ppt
 
Two marks with answers ME6501 CAD
Two marks with answers ME6501 CADTwo marks with answers ME6501 CAD
Two marks with answers ME6501 CAD
 

More from KelvinDube4

CLOUD_COMPUTING_PRESENTATION.pptx
CLOUD_COMPUTING_PRESENTATION.pptxCLOUD_COMPUTING_PRESENTATION.pptx
CLOUD_COMPUTING_PRESENTATION.pptxKelvinDube4
 
introduction.pptx
introduction.pptxintroduction.pptx
introduction.pptxKelvinDube4
 
boundary_security.pptx
boundary_security.pptxboundary_security.pptx
boundary_security.pptxKelvinDube4
 
DATA COM PRESENTATION-1.pptx
DATA COM PRESENTATION-1.pptxDATA COM PRESENTATION-1.pptx
DATA COM PRESENTATION-1.pptxKelvinDube4
 
Fundamental_Security_Design_Principles.pptx
Fundamental_Security_Design_Principles.pptxFundamental_Security_Design_Principles.pptx
Fundamental_Security_Design_Principles.pptxKelvinDube4
 
Group 5 Presentation.pptx
Group 5 Presentation.pptxGroup 5 Presentation.pptx
Group 5 Presentation.pptxKelvinDube4
 
Group 6 Presentation - Copy.pptx
Group 6 Presentation - Copy.pptxGroup 6 Presentation - Copy.pptx
Group 6 Presentation - Copy.pptxKelvinDube4
 

More from KelvinDube4 (7)

CLOUD_COMPUTING_PRESENTATION.pptx
CLOUD_COMPUTING_PRESENTATION.pptxCLOUD_COMPUTING_PRESENTATION.pptx
CLOUD_COMPUTING_PRESENTATION.pptx
 
introduction.pptx
introduction.pptxintroduction.pptx
introduction.pptx
 
boundary_security.pptx
boundary_security.pptxboundary_security.pptx
boundary_security.pptx
 
DATA COM PRESENTATION-1.pptx
DATA COM PRESENTATION-1.pptxDATA COM PRESENTATION-1.pptx
DATA COM PRESENTATION-1.pptx
 
Fundamental_Security_Design_Principles.pptx
Fundamental_Security_Design_Principles.pptxFundamental_Security_Design_Principles.pptx
Fundamental_Security_Design_Principles.pptx
 
Group 5 Presentation.pptx
Group 5 Presentation.pptxGroup 5 Presentation.pptx
Group 5 Presentation.pptx
 
Group 6 Presentation - Copy.pptx
Group 6 Presentation - Copy.pptxGroup 6 Presentation - Copy.pptx
Group 6 Presentation - Copy.pptx
 

Recently uploaded

定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一Fs sss
 
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCRdollysharma2066
 
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxKindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxLesterJayAquino
 
Issues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxIssues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxJenniferPeraro1
 
Navigating the Data Economy: Transforming Recruitment and Hiring
Navigating the Data Economy: Transforming Recruitment and HiringNavigating the Data Economy: Transforming Recruitment and Hiring
Navigating the Data Economy: Transforming Recruitment and Hiringkaran651042
 
MIdterm Review International Trade.pptx review
MIdterm Review International Trade.pptx reviewMIdterm Review International Trade.pptx review
MIdterm Review International Trade.pptx reviewSheldon Byron
 
Ethics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptEthics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptShafqatShakeel1
 
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...RegineManuel2
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfaae4149584
 
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一A SSS
 
do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of JobRemote DBA Services
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一2s3dgmej
 
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一fjjwgk
 
LESSON O1_The Meaning and Importance of MICE.pdf
LESSON O1_The Meaning and Importance of MICE.pdfLESSON O1_The Meaning and Importance of MICE.pdf
LESSON O1_The Meaning and Importance of MICE.pdf0471992maroyal
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Riya Pathan
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter TerrorismNilendra Kumar
 
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证diploma001
 
定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一z zzz
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
 
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
 
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docxKindergarten-DLL-MELC-Q3-Week 2 asf.docx
Kindergarten-DLL-MELC-Q3-Week 2 asf.docx
 
Issues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptxIssues in the Philippines (Unemployment and Underemployment).pptx
Issues in the Philippines (Unemployment and Underemployment).pptx
 
Navigating the Data Economy: Transforming Recruitment and Hiring
Navigating the Data Economy: Transforming Recruitment and HiringNavigating the Data Economy: Transforming Recruitment and Hiring
Navigating the Data Economy: Transforming Recruitment and Hiring
 
MIdterm Review International Trade.pptx review
MIdterm Review International Trade.pptx reviewMIdterm Review International Trade.pptx review
MIdterm Review International Trade.pptx review
 
Ethics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.pptEthics of Animal Research Laika mission.ppt
Ethics of Animal Research Laika mission.ppt
 
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
Drawing animals and props.pptxDrawing animals and props.pptxDrawing animals a...
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdf
 
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
 
do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Job
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
 
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
定制(ECU毕业证书)埃迪斯科文大学毕业证毕业证成绩单原版一比一
 
LESSON O1_The Meaning and Importance of MICE.pdf
LESSON O1_The Meaning and Importance of MICE.pdfLESSON O1_The Meaning and Importance of MICE.pdf
LESSON O1_The Meaning and Importance of MICE.pdf
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter Terrorism
 
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
原版定制卡尔加里大学毕业证(UC毕业证)留信学历认证
 
定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一定制英国克兰菲尔德大学毕业证成绩单原版一比一
定制英国克兰菲尔德大学毕业证成绩单原版一比一
 
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
办理学位证(纽伦堡大学文凭证书)纽伦堡大学毕业证成绩单原版一模一样
 

Group 5 Presentation.pptx

  • 1. Group 6 Presentation Name Takudzwa Mutambu Ngonidzashe Mwendera Gerald Matanhire Devotion Masikati Tapiwanashe Gwena Shamiso Khumbula Kelvin Dube Assani Saidi Reg Number R192975T R197295X R1912448M R1915853W R1912331Z R1913840M R175251T R194565B
  • 2. Introduction • The line clipping is a process in which we can cut the part of the line, which lies outside the view pane. Only those lines are visible, which lie inside the view pane. • The Cohen-Sutherland line clipping algorithm is a common method used in computer graphics to efficiently clip lines against a rectangular clipping window. Line clipping is an important task in computer graphics because it allows us to selectively display only the portions of a line that are visible within a given viewport or window while discarding the portions that lie outside of it. This can improve the overall performance and visual quality of a graphics application, particularly when rendering complex scenes. • In this presentation, we will introduce the Cohen-Sutherland line clipping algorithm, explain how it works, demonstrate its use with an example, discuss its advantages and limitations.
  • 5. How the algorithm works • We will divide the view pane into nine equal segments that only serve the viewport. • We will represent the top, bottom, left, and right corner of the window with 4 bits. These 4 bits can be described with the following point: • If an object lies within any particular corner position, that corner value will be 1, else it will be 0. • The allocation of bits depends on “TBRL” (Top, Bottom, Right, Left) rule. • Suppose, if the point of a line appears in the top-left corner, then according to TBRL, the value is 1001. We will allot the bits as- • For the top corner, because the object is present at the top corner. • For the bottom corner, because the object does not lie at the bottom. • For the right corner, because the object does not lie at the right side. • For the left corner, because the object lies at the top-left corner. • In this way, we check TBRL for each segment and allot the bits accordingly.
  • 7. Line Viewing • In Cohen- Sutherland Algorithm we will divide the lines into following Sections • Visible Line: When both points (starting and ending) of the line are entirely situated inside the window. • Invisible Line: When both points (Starting and ending) of the line are completely situated outside the window. • Clipped Line: Everyline has two endpoints. Let (x0, y0) and (x1, y1) are points of the line. If one point of the line situated inside the window and the other one is outside the window, then the line is known as Clipped Line.
  • 8. Steps when using the Algorithm 1.Determine the region codes for the endpoints of the line. 2.Check if both endpoints are within the clipping window (region code = 0000). If they are, the line is completely inside the window and can be displayed. 3.If both endpoints have a region code that has a common bit value of 1, the line is completely outside the clipping window and can be rejected.
  • 9. Step 4 • If the line is partially inside the clipping window, perform line clipping using the following steps: • a. Find the intersection of the line with the clipping window boundaries. • b. If an endpoint lies outside the clipping window, replace it with the intersection point. • c. Recalculate the region codes for the new endpoints. • d. Repeat steps b and c until both endpoints lie within the clipping window or the line is completely outside.
  • 10. Example In the below-mentioned example, we have different lines. The different category of the line
  • 11. Example • Line AB is a clipped case. • The line CD is completely visible. • Line EF is completely invisible. • Line GH is a clipped case. • Line KL is completely invisible. • Line IJ is a clipped case.
  • 12. Endpoints of the Lines • The endpoints of lines are lies as follow • A ? 0000 • B ? 1010 • C ? 0000 • D ? 0000 • E ? 0100 • F ? 0100 • G ? 0001 • H ? 0000 • I ? 0000 • J ? 0010 • K ? 1000 • L ? 1000
  • 13. Applications of the Algorithm 1. Line Clipping in Computer Graphics: The primary application of the Cohen-Sutherland algorithm is in line clipping for rendering graphics. It efficiently determines which portions of a line lie inside or outside a given clipping window, allowing for the rendering of only the visible parts of the line. This helps optimize the rendering process and improve the overall efficiency of graphics systems. 2. Window and Viewport Clipping: The Cohen-Sutherland algorithm can be used for window and viewport clipping in graphical user interfaces (GUIs). It determines which portions of a window or viewport lie within the visible area, ensuring that only the visible content is displayed. This is particularly useful when working with large documents or images that need to be displayed within a limited viewing area.
  • 14. Applications 1. Line Clipping in CAD Systems: Computer-aided design (CAD) systems often make use of the Cohen-Sutherland algorithm for line clipping operations. It enables the efficient manipulation and display of lines and geometries within the CAD environment. The algorithm ensures that only the visible portions of lines are displayed, allowing designers and engineers to work with accurate and visually appealing representations. 2. Image Processing and Digital Photography: In image processing and digital photography applications, the Cohen- Sutherland algorithm can be utilized for cropping or trimming images. It allows for the precise selection of regions of interest and removal of unwanted portions, resulting in improved composition and visual aesthetics.
  • 15. Advantages of the algorithm • Ability to handle arbitrary clipping windows: The algorithm can handle clipping windows of any shape, not just rectangular ones. This makes it more flexible and versatile than other clipping algorithms that are limited to rectangular windows. • Efficiency in handling many different types of lines: The algorithm is efficient in handling many different types of lines, including vertical, horizontal, and diagonal lines. It can also handle lines of any slope, including those that are steep or nearly horizontal. • Easy to implement: The algorithm is relatively easy to implement and can be adapted to a variety of programming languages and environments.
  • 16. Limitations • Inability to handle curved lines: The algorithm is not capable of handling curved lines, which can be a significant limitation in some cases. Other algorithms, such as the Cyrus-Beck algorithm, can handle curved lines but may not be as efficient as the Cohen-Sutherland algorithm. • Limited to line clipping: The Cohen-Sutherland algorithm is designed specifically for line clipping and cannot be used for other types of clipping, such as polygon clipping. • Requires pre-processing: The algorithm requires pre-processing to compute the two-bit codes for each point or line segment, which can add some overhead to the overall clipping process.