SlideShare a Scribd company logo
Implementation II
Objectives
• Introduce clipping algorithms for polygons
• Survey hidden-surface algorithms
2
Polygon Clipping
• Not as simple as line segment clipping
• Clipping a line segment yields at most one line segment
• Clipping a polygon can yield multiple polygons
• However, clipping a convex polygon can yield at most one other
polygon
3
Tessellation and Convexity
•One strategy is to replace nonconvex (concave)
polygons with a set of triangular polygons (a
tessellation)
•Also makes fill easier
•Tessellation code in GLU library
4
Clipping as a Black Box
• Can consider line segment clipping as a process that takes in two
vertices and produces either no vertices or the vertices of a clipped
line segment
5
Pipeline Clipping of Line Segments
• Clipping against each side of window is independent of other sides
• Can use four independent clippers in a pipeline
6
Pipeline Clipping of Polygons
•Three dimensions: add front and back clippers
•Strategy used in SGI Geometry Engine
•Small increase in latency
7
Bounding Boxes
•Rather than doing clipping on a complex polygon, we
can use an axis-aligned bounding box or extent
• Smallest rectangle aligned with axes that encloses the polygon
• Simple to compute: max and min of x and y
8
Bounding boxes
Can usually determine accept/reject based only on bounding box
9
reject
accept
requires detailed
clipping
Clipping and Visibility
• Clipping has much in common with hidden-surface removal
• In both cases, we are trying to remove objects that are not visible to
the camera
• Often we can use visibility or occlusion testing early in the process to
eliminate as many polygons as possible before going through the
entire pipeline
10
Hidden Surface Removal
• Object-space approach: use pairwise testing between polygons
(objects)
• Worst case complexity O(n2
) for n polygons
11
partially obscuring can draw independently
Painter’s Algorithm
• Render polygons a back to front order so that polygons behind
others are simply painted over
12
B behind A as seen by viewer Fill B then A
Depth Sort
• Requires ordering of polygons first
• O(n log n) calculation for ordering
• Not every polygon is either in front or behind all other polygons
•Order polygons and deal with
easy cases first, harder later
13
Polygons sorted by
distance from COP
Easy Cases
• A lies behind all other polygons
• Can render
• Polygons overlap in z but not in either x or y
• Can render independently
14
Hard Cases
15
Overlap in all directions
but can one is fully on
one side of the other
cyclic overlap
penetration
Back-Face Removal (Culling)
θ
16
•face is visible iff 90 ≥ θ ≥ -90
equivalently cos θ ≥ 0
or v • n ≥ 0
•plane of face has form ax + by +cz +d =0
but after normalization n = ( 0 0 1 0)T
•need only test the sign of c
•In OpenGL we can simply enable culling
but may not work correctly if we have nonconvex objects
Image Space Approach
• Look at each projector (nm for an n x m frame buffer) and find
closest of k polygons
• Complexity O(nmk)
• Ray tracing
• z-buffer
17
z-Buffer Algorithm
•Use a buffer called the z or depth buffer to store the
depth of the closest object at each pixel found so far
•As we render each polygon, compare the depth of
each pixel to depth in z buffer
•If less, place shade of pixel in color buffer and update
z buffer
18
Efficiency
• If we work scan line by scan line as we move across a scan line, the
depth changes satisfy a∆x+b∆y+c∆z=0
19
Along scan line
∆y = 0
∆z = - ∆x
c
a
In screen space ∆x = 1
Scan-Line Algorithm
• Can combine shading and hsr through scan line algorithm
20
scan line i: no need for depth
information, can only be in no
or one polygon
scan line j: need depth
information only when in
more than one polygon
Implementation
• Need a data structure to store
• Flag for each polygon (inside/outside)
• Incremental structure for scan lines that stores which edges are encountered
• Parameters for planes
21
Visibility Testing
• In many realtime applications, such as games, we want to eliminate
as many objects as possible within the application
• Reduce burden on pipeline
• Reduce traffic on bus
• Partition space with Binary Spatial Partition (BSP) Tree
22
Simple Example
23
consider 6 parallel polygons
top view
The plane of A separates B and C from D, E and F
BSP Tree
• Can continue recursively
• Plane of C separates B from A
• Plane of D separates E and F
• Can put this information in a BSP tree
• Use for visibility and occlusion testing
24

More Related Content

What's hot

Relief Clipping Planes (SIGGRAPH ASIA 2008)
Relief Clipping Planes (SIGGRAPH ASIA 2008)Relief Clipping Planes (SIGGRAPH ASIA 2008)
Relief Clipping Planes (SIGGRAPH ASIA 2008)Matthias Trapp
 
Continuously Adaptive Mean Shift(CAMSHIFT)
Continuously Adaptive Mean Shift(CAMSHIFT)Continuously Adaptive Mean Shift(CAMSHIFT)
Continuously Adaptive Mean Shift(CAMSHIFT)
Hansol Kang
 
Programmable Piplelines
Programmable PiplelinesProgrammable Piplelines
Programmable Piplelines
Syed Zaid Irshad
 
Machine vision technique to avoid alignment failure in space launch vehicle
Machine vision technique to avoid alignment failure in space launch vehicleMachine vision technique to avoid alignment failure in space launch vehicle
Machine vision technique to avoid alignment failure in space launch vehicle
Suseetharan Vijayakumaran
 
Efficient HPR-based Rendering of Point Clouds
Efficient HPR-based Rendering of Point CloudsEfficient HPR-based Rendering of Point Clouds
Efficient HPR-based Rendering of Point Clouds
Roger Hernando Buch
 
GeoHex LT at FOSS4G 2010 Tokyo
GeoHex LT at FOSS4G 2010 Tokyo GeoHex LT at FOSS4G 2010 Tokyo
GeoHex LT at FOSS4G 2010 Tokyo
Tadayasu Sasada
 
7th math c2 -l20
7th math c2 -l207th math c2 -l20
7th math c2 -l20jdurst65
 
Analytical models of learning curves with variable processing time
Analytical models of learning curves with variable processing timeAnalytical models of learning curves with variable processing time
Analytical models of learning curves with variable processing timeSagarika Muthukumarana
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhm
Md Mosharof Hosen
 
Things to do with OpenStreetMap
Things to do with OpenStreetMapThings to do with OpenStreetMap
Hubba Deep Learning
Hubba Deep LearningHubba Deep Learning
Hubba Deep Learning
Ivan Goloskokovic
 
Deep Learning meetup
Deep Learning meetupDeep Learning meetup
Deep Learning meetup
Ivan Goloskokovic
 
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
Digipolis Antwerpen
 
for "Parallelizing Multiple Group-by Queries using MapReduce"
for "Parallelizing Multiple Group-by Queries using MapReduce"for "Parallelizing Multiple Group-by Queries using MapReduce"
for "Parallelizing Multiple Group-by Queries using MapReduce"
Yun-Yan Chi
 
07 a70110 remotesensingandgisapplications
07 a70110 remotesensingandgisapplications07 a70110 remotesensingandgisapplications
07 a70110 remotesensingandgisapplicationsimaduddin91
 
Viscomp2 Course: Textures
Viscomp2 Course: TexturesViscomp2 Course: Textures
Viscomp2 Course: Texturescristiangb
 

What's hot (19)

Relief Clipping Planes (SIGGRAPH ASIA 2008)
Relief Clipping Planes (SIGGRAPH ASIA 2008)Relief Clipping Planes (SIGGRAPH ASIA 2008)
Relief Clipping Planes (SIGGRAPH ASIA 2008)
 
Continuously Adaptive Mean Shift(CAMSHIFT)
Continuously Adaptive Mean Shift(CAMSHIFT)Continuously Adaptive Mean Shift(CAMSHIFT)
Continuously Adaptive Mean Shift(CAMSHIFT)
 
Programmable Piplelines
Programmable PiplelinesProgrammable Piplelines
Programmable Piplelines
 
Shive
ShiveShive
Shive
 
Machine vision technique to avoid alignment failure in space launch vehicle
Machine vision technique to avoid alignment failure in space launch vehicleMachine vision technique to avoid alignment failure in space launch vehicle
Machine vision technique to avoid alignment failure in space launch vehicle
 
Efficient HPR-based Rendering of Point Clouds
Efficient HPR-based Rendering of Point CloudsEfficient HPR-based Rendering of Point Clouds
Efficient HPR-based Rendering of Point Clouds
 
final_presentation
final_presentationfinal_presentation
final_presentation
 
GeoHex LT at FOSS4G 2010 Tokyo
GeoHex LT at FOSS4G 2010 Tokyo GeoHex LT at FOSS4G 2010 Tokyo
GeoHex LT at FOSS4G 2010 Tokyo
 
7th math c2 -l20
7th math c2 -l207th math c2 -l20
7th math c2 -l20
 
Analytical models of learning curves with variable processing time
Analytical models of learning curves with variable processing timeAnalytical models of learning curves with variable processing time
Analytical models of learning curves with variable processing time
 
Ray casting algorithm by mhm
Ray casting algorithm by mhmRay casting algorithm by mhm
Ray casting algorithm by mhm
 
Things to do with OpenStreetMap
Things to do with OpenStreetMapThings to do with OpenStreetMap
Things to do with OpenStreetMap
 
workspace_analysis
workspace_analysisworkspace_analysis
workspace_analysis
 
Hubba Deep Learning
Hubba Deep LearningHubba Deep Learning
Hubba Deep Learning
 
Deep Learning meetup
Deep Learning meetupDeep Learning meetup
Deep Learning meetup
 
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
Meetup 12/12/2018: Augmented & Virtual Reality: wat zijn de mogelijkheden voo...
 
for "Parallelizing Multiple Group-by Queries using MapReduce"
for "Parallelizing Multiple Group-by Queries using MapReduce"for "Parallelizing Multiple Group-by Queries using MapReduce"
for "Parallelizing Multiple Group-by Queries using MapReduce"
 
07 a70110 remotesensingandgisapplications
07 a70110 remotesensingandgisapplications07 a70110 remotesensingandgisapplications
07 a70110 remotesensingandgisapplications
 
Viscomp2 Course: Textures
Viscomp2 Course: TexturesViscomp2 Course: Textures
Viscomp2 Course: Textures
 

Similar to Implementation

Implementation
ImplementationImplementation
Implementation
Syed Zaid Irshad
 
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
srinivasan779644
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
ABDULSAMADKAZI
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
KKARUNKARTHIK
 
CS401_M2_L6_Solid Area Scan Conversion.pptx
CS401_M2_L6_Solid Area Scan Conversion.pptxCS401_M2_L6_Solid Area Scan Conversion.pptx
CS401_M2_L6_Solid Area Scan Conversion.pptx
lara333479
 
7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf
nikamomkarshahaji
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
Ahmed Daoud
 
ch4.pptx
ch4.pptxch4.pptx
ch4.pptx
OnkarTalekar4
 
Clipping
ClippingClipping
Clipping
Akash Gupta
 
2IV60_11_hidden_surfaces (6).ppt
2IV60_11_hidden_surfaces (6).ppt2IV60_11_hidden_surfaces (6).ppt
2IV60_11_hidden_surfaces (6).ppt
ssuser024cb2
 
hidden surface removal in computer graphics
hidden surface removal in computer graphicshidden surface removal in computer graphics
hidden surface removal in computer graphics
srinivasan779644
 
Computer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal AlgorithmComputer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal Algorithm
Jyotiraman De
 
Clipping
ClippingClipping
Clipping
nehrurevathy
 
CAD/CAM/CAE - Notes
CAD/CAM/CAE - NotesCAD/CAM/CAE - Notes
CAD/CAM/CAE - Notes
Learn With GeekAlign
 
Clipping 22
Clipping 22Clipping 22
Clipping 22
lokesh503
 
Clipping 22
Clipping 22Clipping 22
Clipping 22
Lokesh Reddy
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
Hema Kashyap
 
Surface design and visible surfaces
Surface design and visible surfacesSurface design and visible surfaces
Surface design and visible surfaces
Arti Parab Academics
 
cg mod2.pdf
cg mod2.pdfcg mod2.pdf
cg mod2.pdf
ssuserf3db48
 

Similar to Implementation (20)

Implementation
ImplementationImplementation
Implementation
 
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
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
 
Hidden surface removal algorithm
Hidden surface removal algorithmHidden surface removal algorithm
Hidden surface removal algorithm
 
CS401_M2_L6_Solid Area Scan Conversion.pptx
CS401_M2_L6_Solid Area Scan Conversion.pptxCS401_M2_L6_Solid Area Scan Conversion.pptx
CS401_M2_L6_Solid Area Scan Conversion.pptx
 
7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf7-Clipping-16 (1).pdf
7-Clipping-16 (1).pdf
 
Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
 
ch4.pptx
ch4.pptxch4.pptx
ch4.pptx
 
Clipping
ClippingClipping
Clipping
 
2IV60_11_hidden_surfaces (6).ppt
2IV60_11_hidden_surfaces (6).ppt2IV60_11_hidden_surfaces (6).ppt
2IV60_11_hidden_surfaces (6).ppt
 
hidden surface removal in computer graphics
hidden surface removal in computer graphicshidden surface removal in computer graphics
hidden surface removal in computer graphics
 
Computer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal AlgorithmComputer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal Algorithm
 
Clipping
ClippingClipping
Clipping
 
lecture8 clipping
lecture8 clippinglecture8 clipping
lecture8 clipping
 
CAD/CAM/CAE - Notes
CAD/CAM/CAE - NotesCAD/CAM/CAE - Notes
CAD/CAM/CAE - Notes
 
Clipping 22
Clipping 22Clipping 22
Clipping 22
 
Clipping 22
Clipping 22Clipping 22
Clipping 22
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
 
Surface design and visible surfaces
Surface design and visible surfacesSurface design and visible surfaces
Surface design and visible surfaces
 
cg mod2.pdf
cg mod2.pdfcg mod2.pdf
cg mod2.pdf
 

More from Syed Zaid Irshad

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

Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 

Recently uploaded (20)

Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 

Implementation

  • 2. Objectives • Introduce clipping algorithms for polygons • Survey hidden-surface algorithms 2
  • 3. Polygon Clipping • Not as simple as line segment clipping • Clipping a line segment yields at most one line segment • Clipping a polygon can yield multiple polygons • However, clipping a convex polygon can yield at most one other polygon 3
  • 4. Tessellation and Convexity •One strategy is to replace nonconvex (concave) polygons with a set of triangular polygons (a tessellation) •Also makes fill easier •Tessellation code in GLU library 4
  • 5. Clipping as a Black Box • Can consider line segment clipping as a process that takes in two vertices and produces either no vertices or the vertices of a clipped line segment 5
  • 6. Pipeline Clipping of Line Segments • Clipping against each side of window is independent of other sides • Can use four independent clippers in a pipeline 6
  • 7. Pipeline Clipping of Polygons •Three dimensions: add front and back clippers •Strategy used in SGI Geometry Engine •Small increase in latency 7
  • 8. Bounding Boxes •Rather than doing clipping on a complex polygon, we can use an axis-aligned bounding box or extent • Smallest rectangle aligned with axes that encloses the polygon • Simple to compute: max and min of x and y 8
  • 9. Bounding boxes Can usually determine accept/reject based only on bounding box 9 reject accept requires detailed clipping
  • 10. Clipping and Visibility • Clipping has much in common with hidden-surface removal • In both cases, we are trying to remove objects that are not visible to the camera • Often we can use visibility or occlusion testing early in the process to eliminate as many polygons as possible before going through the entire pipeline 10
  • 11. Hidden Surface Removal • Object-space approach: use pairwise testing between polygons (objects) • Worst case complexity O(n2 ) for n polygons 11 partially obscuring can draw independently
  • 12. Painter’s Algorithm • Render polygons a back to front order so that polygons behind others are simply painted over 12 B behind A as seen by viewer Fill B then A
  • 13. Depth Sort • Requires ordering of polygons first • O(n log n) calculation for ordering • Not every polygon is either in front or behind all other polygons •Order polygons and deal with easy cases first, harder later 13 Polygons sorted by distance from COP
  • 14. Easy Cases • A lies behind all other polygons • Can render • Polygons overlap in z but not in either x or y • Can render independently 14
  • 15. Hard Cases 15 Overlap in all directions but can one is fully on one side of the other cyclic overlap penetration
  • 16. Back-Face Removal (Culling) θ 16 •face is visible iff 90 ≥ θ ≥ -90 equivalently cos θ ≥ 0 or v • n ≥ 0 •plane of face has form ax + by +cz +d =0 but after normalization n = ( 0 0 1 0)T •need only test the sign of c •In OpenGL we can simply enable culling but may not work correctly if we have nonconvex objects
  • 17. Image Space Approach • Look at each projector (nm for an n x m frame buffer) and find closest of k polygons • Complexity O(nmk) • Ray tracing • z-buffer 17
  • 18. z-Buffer Algorithm •Use a buffer called the z or depth buffer to store the depth of the closest object at each pixel found so far •As we render each polygon, compare the depth of each pixel to depth in z buffer •If less, place shade of pixel in color buffer and update z buffer 18
  • 19. Efficiency • If we work scan line by scan line as we move across a scan line, the depth changes satisfy a∆x+b∆y+c∆z=0 19 Along scan line ∆y = 0 ∆z = - ∆x c a In screen space ∆x = 1
  • 20. Scan-Line Algorithm • Can combine shading and hsr through scan line algorithm 20 scan line i: no need for depth information, can only be in no or one polygon scan line j: need depth information only when in more than one polygon
  • 21. Implementation • Need a data structure to store • Flag for each polygon (inside/outside) • Incremental structure for scan lines that stores which edges are encountered • Parameters for planes 21
  • 22. Visibility Testing • In many realtime applications, such as games, we want to eliminate as many objects as possible within the application • Reduce burden on pipeline • Reduce traffic on bus • Partition space with Binary Spatial Partition (BSP) Tree 22
  • 23. Simple Example 23 consider 6 parallel polygons top view The plane of A separates B and C from D, E and F
  • 24. BSP Tree • Can continue recursively • Plane of C separates B from A • Plane of D separates E and F • Can put this information in a BSP tree • Use for visibility and occlusion testing 24