SlideShare a Scribd company logo
1 of 21
Implementation III
Objectives
• Survey Line Drawing Algorithms
• DDA
• Bresenham
2
Rasterization
• Rasterization (scan conversion)
• Determine which pixels that are inside primitive specified by a set of vertices
• Produces a set of fragments
• Fragments have a location (pixel location) and other attributes such color
and texture coordinates that are determined by interpolating values at
vertices
• Pixel colors determined later using color, texture, and other vertex
properties
3
Scan Conversion of Line Segments
• Start with line segment in window coordinates with integer values
for endpoints
• Assume implementation has a write_pixel function
4
y = mx + h
x
y
m
∆
∆
=
DDA Algorithm
•Digital Differential Analyzer
• DDA was a mechanical device for numerical solution of differential equations
• Line y=mx+ h satisfies differential equation
dy/dx = m = ∆y/∆x = y2-y1/x2-x1
•Along scan line ∆x = 1
5
For(x=x1; x<=x2,ix++) {
y+=m;
write_pixel(x, round(y), line_color)
}
Problem
• DDA = for each x plot pixel at closest y
• Problems for steep lines
6
Using Symmetry
• Use for 1 ≥ m ≥ 0
• For m > 1, swap role of x and y
• For each y, plot closest x
7
Bresenham’s Algorithm
•DDA requires one floating point addition per step
•We can eliminate all fp through Bresenham’s
algorithm
•Consider only 1 ≥ m ≥ 0
• Other cases by symmetry
•Assume pixel centers are at half integers
•If we start at a pixel that has been written, there are
only two candidates for the next pixel to be written
into the frame buffer
8
Candidate Pixels
9
1 ≥ m ≥ 0
last pixel
candidates
Note that line could have
passed through any
part of this pixel
Decision Variable
-
10
d = ∆x(b-a)
d is an integer
d > 0 use upper pixel
d < 0 use lower pixel
Incremental Form
• More efficient if we look at dk, the value of the decision variable at x
= k
11
dk+1= dk –2∆y, if dk <0
dk+1= dk –2(∆y- ∆x), otherwise
•For each x, we need do only an integer
addition and a test
•Single instruction on graphics chips
Polygon Scan Conversion
• Scan Conversion = Fill
• How to tell inside from outside
• Convex easy
• Nonsimple difficult
• Odd even test
• Count edge crossings
•Winding number
12
odd-even fill
Winding Number
• Count clockwise encirclements of point
• Alternate definition of inside: inside if winding number ≠ 0
13
winding number = 2
winding number = 1
Filling in the Frame Buffer
• Fill at end of pipeline
• Convex Polygons only
• Nonconvex polygons assumed to have been tessellated
• Shades (colors) have been computed for vertices (Gouraud shading)
• Combine with z-buffer algorithm
• March across scan lines interpolating shades
• Incremental work small
14
Using Interpolation
C1 C2 C3specified by glColor or by vertex shading
C4 determined by interpolating between C1 and C2
C5 determined by interpolating between C2 and C3
interpolate between C4 and C5 along span
15
span
C1
C3
C2
C5
C4
scan line
Flood Fill
•Fill can be done recursively if we know a seed point
located inside (WHITE)
•Scan convert edges into buffer in edge/inside color
(BLACK)
16
flood_fill(int x, int y) {
if(read_pixel(x,y)= = WHITE) {
write_pixel(x,y,BLACK);
flood_fill(x-1, y);
flood_fill(x+1, y);
flood_fill(x, y+1);
flood_fill(x, y-1);
} }
Scan Line Fill
•Can also fill by maintaining a data structure of all
intersections of polygons with scan lines
• Sort by scan line
• Fill each span
17
vertex order generated
by vertex list desired order
Data Structure
18
Aliasing
• Ideal rasterized line should be 1 pixel wide
• Choosing best y for each x (or visa versa) produces aliased raster lines
19
Antialiasing by Area Averaging
•Color multiple pixels for each x depending on
coverage by ideal line
20
original antialiased
magnified
Polygon Aliasing
• Aliasing problems can be serious for polygons
• Jaggedness of edges
• Small polygons neglected
• Need compositing so color
of one polygon does not
totally determine color of
pixel
21
All three polygons should contribute to color

More Related Content

What's hot

Md2k 0219 shang
Md2k 0219 shangMd2k 0219 shang
Md2k 0219 shangBBKuhn
 
IOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_presentIOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_presentShubham Joshi
 
hospital management
hospital managementhospital management
hospital managementguestbcbbb5c
 
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...Mumbai B.Sc.IT Study
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and PolynomialAroosa Rajput
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseJohn Cook
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dagsindhu mathi
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlabTUOS-Sam
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithmMani Kanth
 
Example of iterative deepening search &amp; bidirectional search
Example of iterative deepening search &amp; bidirectional searchExample of iterative deepening search &amp; bidirectional search
Example of iterative deepening search &amp; bidirectional searchAbhijeet Agarwal
 
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S..."Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...Edge AI and Vision Alliance
 
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION By Sintiak Haque
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION  By Sintiak Haque4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION  By Sintiak Haque
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION By Sintiak HaqueSintiak haque
 
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionSIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionKoji Asami
 
Deep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullDeep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullHanqing Wang
 
Radial Basis Function and Splines.
Radial Basis Function and Splines.Radial Basis Function and Splines.
Radial Basis Function and Splines.BikashBaruah6
 
Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Nicole Valerio
 

What's hot (19)

Md2k 0219 shang
Md2k 0219 shangMd2k 0219 shang
Md2k 0219 shang
 
IOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_presentIOEfficientParalleMatrixMultiplication_present
IOEfficientParalleMatrixMultiplication_present
 
Arrays
ArraysArrays
Arrays
 
hospital management
hospital managementhospital management
hospital management
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and Polynomial
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverse
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dags
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Example of iterative deepening search &amp; bidirectional search
Example of iterative deepening search &amp; bidirectional searchExample of iterative deepening search &amp; bidirectional search
Example of iterative deepening search &amp; bidirectional search
 
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S..."Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...
"Moving CNNs from Academic Theory to Embedded Reality," a Presentation from S...
 
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION By Sintiak Haque
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION  By Sintiak Haque4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION  By Sintiak Haque
4-CONNECTED AND 8-CONNECTED NEIGHBOR SELECTION By Sintiak Haque
 
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solutionSIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
SIGNATE 国立国会図書館の画像データレイアウト認識 1st place solution
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
Deep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hullDeep single view 3 d object reconstruction with visual hull
Deep single view 3 d object reconstruction with visual hull
 
Radial Basis Function and Splines.
Radial Basis Function and Splines.Radial Basis Function and Splines.
Radial Basis Function and Splines.
 
Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry Assignment premier academic writing agency with industry
Assignment premier academic writing agency with industry
 

Similar to Implementation

Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & RasterizationAhmed Daoud
 
Line drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfLine drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfRAJARATNAS
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterizationMaaz Rizwan
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmKasun Ranga Wijeweera
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1aravindangc
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxKokebe2
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptxssuser255bf1
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualAnkit Kumar
 
combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...RishabhSingh308993
 
1536 graphics &amp; graphical programming
1536 graphics &amp; graphical  programming1536 graphics &amp; graphical  programming
1536 graphics &amp; graphical programmingDr Fereidoun Dejahang
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi54MahakBansal
 

Similar to Implementation (20)

Clipping & Rasterization
Clipping & RasterizationClipping & Rasterization
Clipping & Rasterization
 
Line drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdfLine drawing Algorithm DDA in computer Graphics.pdf
Line drawing Algorithm DDA in computer Graphics.pdf
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Boundary fill algm
Boundary fill algmBoundary fill algm
Boundary fill algm
 
Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Lec-4_Rendering-1.pdf
Lec-4_Rendering-1.pdfLec-4_Rendering-1.pdf
Lec-4_Rendering-1.pdf
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx4 CG_U1_M3_PPT_4 DDA.pptx
4 CG_U1_M3_PPT_4 DDA.pptx
 
module 1.pdf
module 1.pdfmodule 1.pdf
module 1.pdf
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
testpang
testpangtestpang
testpang
 
combinational-circuit.pptx it tis creative study of digital electronics for ...
combinational-circuit.pptx it tis creative study of  digital electronics for ...combinational-circuit.pptx it tis creative study of  digital electronics for ...
combinational-circuit.pptx it tis creative study of digital electronics for ...
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Implementation
ImplementationImplementation
Implementation
 
1536 graphics &amp; graphical programming
1536 graphics &amp; graphical  programming1536 graphics &amp; graphical  programming
1536 graphics &amp; graphical programming
 
Programmable Piplelines
Programmable PiplelinesProgrammable Piplelines
Programmable Piplelines
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 

More from 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

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
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
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
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
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 

Recently uploaded (20)

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
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
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
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
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
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...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 

Implementation

  • 2. Objectives • Survey Line Drawing Algorithms • DDA • Bresenham 2
  • 3. Rasterization • Rasterization (scan conversion) • Determine which pixels that are inside primitive specified by a set of vertices • Produces a set of fragments • Fragments have a location (pixel location) and other attributes such color and texture coordinates that are determined by interpolating values at vertices • Pixel colors determined later using color, texture, and other vertex properties 3
  • 4. Scan Conversion of Line Segments • Start with line segment in window coordinates with integer values for endpoints • Assume implementation has a write_pixel function 4 y = mx + h x y m ∆ ∆ =
  • 5. DDA Algorithm •Digital Differential Analyzer • DDA was a mechanical device for numerical solution of differential equations • Line y=mx+ h satisfies differential equation dy/dx = m = ∆y/∆x = y2-y1/x2-x1 •Along scan line ∆x = 1 5 For(x=x1; x<=x2,ix++) { y+=m; write_pixel(x, round(y), line_color) }
  • 6. Problem • DDA = for each x plot pixel at closest y • Problems for steep lines 6
  • 7. Using Symmetry • Use for 1 ≥ m ≥ 0 • For m > 1, swap role of x and y • For each y, plot closest x 7
  • 8. Bresenham’s Algorithm •DDA requires one floating point addition per step •We can eliminate all fp through Bresenham’s algorithm •Consider only 1 ≥ m ≥ 0 • Other cases by symmetry •Assume pixel centers are at half integers •If we start at a pixel that has been written, there are only two candidates for the next pixel to be written into the frame buffer 8
  • 9. Candidate Pixels 9 1 ≥ m ≥ 0 last pixel candidates Note that line could have passed through any part of this pixel
  • 10. Decision Variable - 10 d = ∆x(b-a) d is an integer d > 0 use upper pixel d < 0 use lower pixel
  • 11. Incremental Form • More efficient if we look at dk, the value of the decision variable at x = k 11 dk+1= dk –2∆y, if dk <0 dk+1= dk –2(∆y- ∆x), otherwise •For each x, we need do only an integer addition and a test •Single instruction on graphics chips
  • 12. Polygon Scan Conversion • Scan Conversion = Fill • How to tell inside from outside • Convex easy • Nonsimple difficult • Odd even test • Count edge crossings •Winding number 12 odd-even fill
  • 13. Winding Number • Count clockwise encirclements of point • Alternate definition of inside: inside if winding number ≠ 0 13 winding number = 2 winding number = 1
  • 14. Filling in the Frame Buffer • Fill at end of pipeline • Convex Polygons only • Nonconvex polygons assumed to have been tessellated • Shades (colors) have been computed for vertices (Gouraud shading) • Combine with z-buffer algorithm • March across scan lines interpolating shades • Incremental work small 14
  • 15. Using Interpolation C1 C2 C3specified by glColor or by vertex shading C4 determined by interpolating between C1 and C2 C5 determined by interpolating between C2 and C3 interpolate between C4 and C5 along span 15 span C1 C3 C2 C5 C4 scan line
  • 16. Flood Fill •Fill can be done recursively if we know a seed point located inside (WHITE) •Scan convert edges into buffer in edge/inside color (BLACK) 16 flood_fill(int x, int y) { if(read_pixel(x,y)= = WHITE) { write_pixel(x,y,BLACK); flood_fill(x-1, y); flood_fill(x+1, y); flood_fill(x, y+1); flood_fill(x, y-1); } }
  • 17. Scan Line Fill •Can also fill by maintaining a data structure of all intersections of polygons with scan lines • Sort by scan line • Fill each span 17 vertex order generated by vertex list desired order
  • 19. Aliasing • Ideal rasterized line should be 1 pixel wide • Choosing best y for each x (or visa versa) produces aliased raster lines 19
  • 20. Antialiasing by Area Averaging •Color multiple pixels for each x depending on coverage by ideal line 20 original antialiased magnified
  • 21. Polygon Aliasing • Aliasing problems can be serious for polygons • Jaggedness of edges • Small polygons neglected • Need compositing so color of one polygon does not totally determine color of pixel 21 All three polygons should contribute to color