SlideShare a Scribd company logo
1 of 23
Implementation I
1
Objectives
ā€¢ Introduce basic implementation strategies
ā€¢ Clipping
ā€¢ Scan conversion
2
Overview
ā€¢ At end of the geometric pipeline, vertices have been assembled into
primitives
ā€¢ Must clip out primitives that are outside the view frustum
ā€¢ Algorithms based on representing primitives by lists of vertices
ā€¢ Must find which pixels can be affected by each primitive
ā€¢ Fragment generation
ā€¢ Rasterization or scan conversion
3
Required Tasks
ā€¢ Clipping
ā€¢ Rasterization or scan conversion
ā€¢ Transformations
ā€¢ Some tasks deferred until fragement processing
ā€¢ Hidden surface removal
ā€¢ Antialiasing
4
Rasterization Meta Algorithms
ā€¢ Consider two approaches to rendering a scene with opaque objects
ā€¢ For every pixel, determine which object that projects on the pixel is
closest to the viewer and compute the shade of this pixel
ā€¢ Ray tracing paradigm
ā€¢ For every object, determine which pixels it covers and shade these
pixels
ā€¢ Pipeline approach
ā€¢ Must keep track of depths
5
Clipping
ā€¢2D against clipping window
ā€¢3D against clipping volume
ā€¢Easy for line segments polygons
ā€¢Hard for curves and text
ā€¢ Convert to lines and polygons first
6
Clipping 2D Line Segments
ā€¢ Brute force approach: compute intersections with all sides of clipping
window
ā€¢ Inefficient: one division per intersection
7
Cohen-Sutherland Algorithm
ā€¢ Idea: eliminate as many cases as possible without computing
intersections
ā€¢ Start with four lines that determine the sides of the clipping window
8
x = xmaxx = xmin
y = ymax
y = ymin
The Cases
ā€¢Case 1: both endpoints of line segment inside all four
lines
ā€¢ Draw (accept) line segment as is
ā€¢Case 2: both endpoints outside all lines and on same
side of a line
ā€¢ Discard (reject) the line segment
9
x = xmaxx = xmin
y = ymax
y = ymin
The Cases
ā€¢ Case 3: One endpoint inside, one outside
ā€¢ Must do at least one intersection
ā€¢ Case 4: Both outside
ā€¢ May have part inside
ā€¢ Must do at least one intersection
10
x = xmaxx = xmin
y = ymax
Defining Outcodes
ā€¢ For each endpoint, define an outcode
ā€¢ Outcodes divide space into 9 regions
ā€¢ Computation of outcode requires at most 4 subtractions
11
b0b1b2b3
b0 = 1 if y > ymax, 0 otherwise
b1 = 1 if y < ymin, 0 otherwise
b2 = 1 if x > xmax, 0 otherwise
b3 = 1 if x < xmin, 0 otherwise
Using Outcodes
ā€¢ Consider the 5 cases below
ā€¢ AB: outcode(A) = outcode(B) = 0
ā€¢ Accept line segment
12
Using Outcodes
ā€¢ CD: outcode (C) = 0, outcode(D) ā‰  0
ā€¢ Compute intersection
ā€¢ Location of 1 in outcode(D) determines which edge to intersect with
ā€¢ Note if there were a segment from A to a point in a region with 2 ones in
outcode, we might have to do two interesections
13
Using Outcodes
ā€¢ EF: outcode(E) logically ANDed with outcode(F) (bitwise) ā‰  0
ā€¢ Both outcodes have a 1 bit in the same place
ā€¢ Line segment is outside of corresponding side of clipping window
ā€¢ reject
14
Using Outcodes
ā€¢ GH and IJ: same outcodes, neither zero but logical AND yields zero
ā€¢ Shorten line segment by intersecting with one of sides of window
ā€¢ Compute outcode of intersection (new endpoint of shortened line
segment)
ā€¢ Reexecute algorithm
15
Efficiency
ā€¢ In many applications, the clipping window is small relative to the size
of the entire data base
ā€¢ Most line segments are outside one or more side of the window and can be
eliminated based on their outcodes
ā€¢ Inefficiency when code has to be reexecuted for line segments that
must be shortened in more than one step
16
Cohen Sutherland in 3D
ā€¢Use 6-bit outcodes
ā€¢When needed, clip line segment against planes
17
Liang-Barsky Clipping
ā€¢ Consider the parametric form of a line segment
ā€¢ We can distinguish between the cases by looking at the
ordering of the values of Ī± where the line determined by the
line segment crosses the lines that determine the window
18
p(Ī±) = (1-Ī±)p1+ Ī±p2 1 ā‰„ Ī± ā‰„ 0
p1
p2
Liang-Barsky Clipping
ā€¢ In (a): Ī±4 > Ī±3 > Ī±2 > Ī±1
ā€¢ Intersect right, top, left, bottom: shorten
ā€¢ In (b): Ī±4 > Ī±2 > Ī±3 > Ī±1
ā€¢ Intersect right, left, top, bottom: reject
19
Advantages
ā€¢ Can accept/reject as easily as with Cohen-Sutherland
ā€¢ Using values of Ī±, we do not have to use algorithm recursively as
with C-S
ā€¢ Extends to 3D
20
Clipping and Normalization
ā€¢ General clipping in 3D requires intersection of line segments against
arbitrary plane
ā€¢ Example: oblique view
21
Plane-Line Intersections
22
)(
)(
12
1
ppn
ppn
a o
āˆ’ā€¢
āˆ’ā€¢
=
Normalized Form
23
before normalization after normalization
Normalization is part of viewing (pre clipping)
but after normalization, we clip against sides of
right parallelepiped
Typical intersection calculation now requires only
a floating point subtraction, e.g. is x > xmax ?
top view

More Related Content

What's hot

Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer GraphicsLaxman Puri
Ā 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clippingMdAlAmin187
Ā 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphicsShaishavShah8
Ā 
Line clipping
Line clippingLine clipping
Line clippingAnkit Garg
Ā 
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
Ā 
Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmTawfiq Ahmed
Ā 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithmMani Kanth
Ā 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clippingMohd Arif
Ā 
Polygon filling
Polygon fillingPolygon filling
Polygon fillingAnkit Garg
Ā 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fillwahab13
Ā 
Area filling algo
Area filling algoArea filling algo
Area filling algoPrince Soni
Ā 
Lect 5 2d clipping
Lect 5 2d clippingLect 5 2d clipping
Lect 5 2d clippingmajicyoung
Ā 
Clipping in Computer Graphics
Clipping in Computer Graphics Clipping in Computer Graphics
Clipping in Computer Graphics Barani Tharan
Ā 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingArvind Kumar
Ā 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 dAshiv Khan
Ā 

What's hot (20)

Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
Ā 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
Ā 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
Ā 
Clipping
ClippingClipping
Clipping
Ā 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphics
Ā 
Line clipping
Line clippingLine clipping
Line clipping
Ā 
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
Ā 
Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithm
Ā 
Curve clipping
Curve clippingCurve clipping
Curve clipping
Ā 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
Ā 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
Ā 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
Ā 
Polygon Fill
Polygon FillPolygon Fill
Polygon Fill
Ā 
Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )Clipping ( Cohen-Sutherland Algorithm )
Clipping ( Cohen-Sutherland Algorithm )
Ā 
Area filling algo
Area filling algoArea filling algo
Area filling algo
Ā 
Lect 5 2d clipping
Lect 5 2d clippingLect 5 2d clipping
Lect 5 2d clipping
Ā 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
Ā 
Clipping in Computer Graphics
Clipping in Computer Graphics Clipping in Computer Graphics
Clipping in Computer Graphics
Ā 
sutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clippingsutherland- Hodgeman Polygon clipping
sutherland- Hodgeman Polygon clipping
Ā 
Clipping in 2 d
Clipping in 2 dClipping in 2 d
Clipping in 2 d
Ā 

Similar to Implementation

Clipping 22
Clipping 22Clipping 22
Clipping 22lokesh503
Ā 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & RasterizationAhmed Daoud
Ā 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clippingMani Kanth
Ā 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsRohit Jain
Ā 
Windowing clipping
Windowing   clippingWindowing   clipping
Windowing clippingShweta Shah
Ā 
Materi_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdfMateri_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdfichsan6
Ā 
visible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingvisible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingsrinivasan779644
Ā 
Lecture1616_16827_2D Clipping.ppt
Lecture1616_16827_2D Clipping.pptLecture1616_16827_2D Clipping.ppt
Lecture1616_16827_2D Clipping.pptGaganvirKaur
Ā 
Image representation
Image representationImage representation
Image representationRahul Dadwal
Ā 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2ozgur_can
Ā 

Similar to Implementation (20)

99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
Ā 
Clipping
ClippingClipping
Clipping
Ā 
Clipping 22
Clipping 22Clipping 22
Clipping 22
Ā 
Clipping 22
Clipping 22Clipping 22
Clipping 22
Ā 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
Ā 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
Ā 
Cohen sutherland line clipping
Cohen sutherland line clippingCohen sutherland line clipping
Cohen sutherland line clipping
Ā 
Implementation
ImplementationImplementation
Implementation
Ā 
7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf
Ā 
ch4.pptx
ch4.pptxch4.pptx
ch4.pptx
Ā 
clipping
clippingclipping
clipping
Ā 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithms
Ā 
Implementation
ImplementationImplementation
Implementation
Ā 
Windowing clipping
Windowing   clippingWindowing   clipping
Windowing clipping
Ā 
Materi_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdfMateri_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdf
Ā 
visible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewingvisible surface detection in 3D objects for viewing
visible surface detection in 3D objects for viewing
Ā 
Lecture1616_16827_2D Clipping.ppt
Lecture1616_16827_2D Clipping.pptLecture1616_16827_2D Clipping.ppt
Lecture1616_16827_2D Clipping.ppt
Ā 
CAD/CAM/CAE - Notes
CAD/CAM/CAE - NotesCAD/CAM/CAE - Notes
CAD/CAM/CAE - Notes
Ā 
Image representation
Image representationImage representation
Image representation
Ā 
Lcdf4 chap 03_p2
Lcdf4 chap 03_p2Lcdf4 chap 03_p2
Lcdf4 chap 03_p2
Ā 

More from Syed Zaid Irshad

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdfSyed Zaid Irshad
Ā 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionSyed Zaid Irshad
Ā 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptxSyed Zaid Irshad
Ā 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxSyed Zaid Irshad
Ā 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in ComputingSyed Zaid Irshad
Ā 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xiSyed Zaid Irshad
Ā 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xiiSyed Zaid Irshad
Ā 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to DatabaseSyed Zaid Irshad
Ā 
Computer Programming
Computer ProgrammingComputer Programming
Computer ProgrammingSyed Zaid Irshad
Ā 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionSyed Zaid Irshad
Ā 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the LawSyed Zaid Irshad
Ā 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer ArchitectureSyed Zaid Irshad
Ā 
Information Networks
Information NetworksInformation Networks
Information NetworksSyed Zaid Irshad
Ā 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information TechnologySyed Zaid Irshad
Ā 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year BookSyed Zaid Irshad
Ā 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operatorsSyed Zaid Irshad
Ā 

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
Ā 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
Ā 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
Ā 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
Ā 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
Ā 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
Ā 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
Ā 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Ā 
C Language
C LanguageC Language
C Language
Ā 
Flowchart
FlowchartFlowchart
Flowchart
Ā 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
Ā 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
Ā 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
Ā 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
Ā 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
Ā 
Data Communication
Data CommunicationData Communication
Data Communication
Ā 
Information Networks
Information NetworksInformation Networks
Information Networks
Ā 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
Ā 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
Ā 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
Ā 

Recently uploaded

CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
Ā 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
Ā 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
Ā 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
Ā 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
Ā 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
Ā 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
Ā 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
Ā 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
Ā 
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort service
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort serviceGurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort service
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort servicejennyeacort
Ā 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
Ā 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
Ā 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
Ā 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
Ā 

Recently uploaded (20)

young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Serviceyoung call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
young call girls in Rajiv ChowkšŸ” 9953056974 šŸ” Delhi escort Service
Ā 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Ā 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Ā 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
Ā 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
Ā 
young call girls in Green ParkšŸ” 9953056974 šŸ” escort Service
young call girls in Green ParkšŸ” 9953056974 šŸ” escort Serviceyoung call girls in Green ParkšŸ” 9953056974 šŸ” escort Service
young call girls in Green ParkšŸ” 9953056974 šŸ” escort Service
Ā 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
Ā 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
Ā 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Ā 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Ā 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
Ā 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
Ā 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Ā 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
Ā 
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort service
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort serviceGurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort service
Gurgaon āœ”ļø9711147426āœØCall In girls Gurgaon Sector 51 escort service
Ā 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
Ā 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
Ā 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
Ā 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
Ā 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
Ā 

Implementation

  • 2. Objectives ā€¢ Introduce basic implementation strategies ā€¢ Clipping ā€¢ Scan conversion 2
  • 3. Overview ā€¢ At end of the geometric pipeline, vertices have been assembled into primitives ā€¢ Must clip out primitives that are outside the view frustum ā€¢ Algorithms based on representing primitives by lists of vertices ā€¢ Must find which pixels can be affected by each primitive ā€¢ Fragment generation ā€¢ Rasterization or scan conversion 3
  • 4. Required Tasks ā€¢ Clipping ā€¢ Rasterization or scan conversion ā€¢ Transformations ā€¢ Some tasks deferred until fragement processing ā€¢ Hidden surface removal ā€¢ Antialiasing 4
  • 5. Rasterization Meta Algorithms ā€¢ Consider two approaches to rendering a scene with opaque objects ā€¢ For every pixel, determine which object that projects on the pixel is closest to the viewer and compute the shade of this pixel ā€¢ Ray tracing paradigm ā€¢ For every object, determine which pixels it covers and shade these pixels ā€¢ Pipeline approach ā€¢ Must keep track of depths 5
  • 6. Clipping ā€¢2D against clipping window ā€¢3D against clipping volume ā€¢Easy for line segments polygons ā€¢Hard for curves and text ā€¢ Convert to lines and polygons first 6
  • 7. Clipping 2D Line Segments ā€¢ Brute force approach: compute intersections with all sides of clipping window ā€¢ Inefficient: one division per intersection 7
  • 8. Cohen-Sutherland Algorithm ā€¢ Idea: eliminate as many cases as possible without computing intersections ā€¢ Start with four lines that determine the sides of the clipping window 8 x = xmaxx = xmin y = ymax y = ymin
  • 9. The Cases ā€¢Case 1: both endpoints of line segment inside all four lines ā€¢ Draw (accept) line segment as is ā€¢Case 2: both endpoints outside all lines and on same side of a line ā€¢ Discard (reject) the line segment 9 x = xmaxx = xmin y = ymax y = ymin
  • 10. The Cases ā€¢ Case 3: One endpoint inside, one outside ā€¢ Must do at least one intersection ā€¢ Case 4: Both outside ā€¢ May have part inside ā€¢ Must do at least one intersection 10 x = xmaxx = xmin y = ymax
  • 11. Defining Outcodes ā€¢ For each endpoint, define an outcode ā€¢ Outcodes divide space into 9 regions ā€¢ Computation of outcode requires at most 4 subtractions 11 b0b1b2b3 b0 = 1 if y > ymax, 0 otherwise b1 = 1 if y < ymin, 0 otherwise b2 = 1 if x > xmax, 0 otherwise b3 = 1 if x < xmin, 0 otherwise
  • 12. Using Outcodes ā€¢ Consider the 5 cases below ā€¢ AB: outcode(A) = outcode(B) = 0 ā€¢ Accept line segment 12
  • 13. Using Outcodes ā€¢ CD: outcode (C) = 0, outcode(D) ā‰  0 ā€¢ Compute intersection ā€¢ Location of 1 in outcode(D) determines which edge to intersect with ā€¢ Note if there were a segment from A to a point in a region with 2 ones in outcode, we might have to do two interesections 13
  • 14. Using Outcodes ā€¢ EF: outcode(E) logically ANDed with outcode(F) (bitwise) ā‰  0 ā€¢ Both outcodes have a 1 bit in the same place ā€¢ Line segment is outside of corresponding side of clipping window ā€¢ reject 14
  • 15. Using Outcodes ā€¢ GH and IJ: same outcodes, neither zero but logical AND yields zero ā€¢ Shorten line segment by intersecting with one of sides of window ā€¢ Compute outcode of intersection (new endpoint of shortened line segment) ā€¢ Reexecute algorithm 15
  • 16. Efficiency ā€¢ In many applications, the clipping window is small relative to the size of the entire data base ā€¢ Most line segments are outside one or more side of the window and can be eliminated based on their outcodes ā€¢ Inefficiency when code has to be reexecuted for line segments that must be shortened in more than one step 16
  • 17. Cohen Sutherland in 3D ā€¢Use 6-bit outcodes ā€¢When needed, clip line segment against planes 17
  • 18. Liang-Barsky Clipping ā€¢ Consider the parametric form of a line segment ā€¢ We can distinguish between the cases by looking at the ordering of the values of Ī± where the line determined by the line segment crosses the lines that determine the window 18 p(Ī±) = (1-Ī±)p1+ Ī±p2 1 ā‰„ Ī± ā‰„ 0 p1 p2
  • 19. Liang-Barsky Clipping ā€¢ In (a): Ī±4 > Ī±3 > Ī±2 > Ī±1 ā€¢ Intersect right, top, left, bottom: shorten ā€¢ In (b): Ī±4 > Ī±2 > Ī±3 > Ī±1 ā€¢ Intersect right, left, top, bottom: reject 19
  • 20. Advantages ā€¢ Can accept/reject as easily as with Cohen-Sutherland ā€¢ Using values of Ī±, we do not have to use algorithm recursively as with C-S ā€¢ Extends to 3D 20
  • 21. Clipping and Normalization ā€¢ General clipping in 3D requires intersection of line segments against arbitrary plane ā€¢ Example: oblique view 21
  • 23. Normalized Form 23 before normalization after normalization Normalization is part of viewing (pre clipping) but after normalization, we clip against sides of right parallelepiped Typical intersection calculation now requires only a floating point subtraction, e.g. is x > xmax ? top view