SlideShare una empresa de Scribd logo
1 de 48
Computer Graphics 4: Bresenham Line  Drawing Algorithm,  Circle Drawing &  Polygon Filling
Contents ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Bresenham Line Algorithm ,[object Object],[object Object],Jack Bresenham worked for 27 years at IBM before entering academia. Bresenham developed his famous algorithms at IBM in the early 1960s
The Big Idea ,[object Object],2 3 4 5 2 4 3 5 For example, from position (2, 3) we have to choose between (3, 3) and (3, 4) We would like the point that is closer to the original line ( x k ,  y k ) ( x k +1,  y k ) ( x k +1,  y k +1)
Deriving The Bresenham Line Algorithm ,[object Object],The  y  coordinate on the mathematical line at  x k + 1  is: y y k y k+ 1 x k + 1 d lower d upper
[object Object],[object Object],[object Object],Deriving The Bresenham Line Algorithm (cont…)
[object Object],[object Object],Deriving The Bresenham Line Algorithm (cont…)
[object Object],[object Object],[object Object],Deriving The Bresenham Line Algorithm (cont…)
[object Object],[object Object],[object Object],Deriving The Bresenham Line Algorithm (cont…)
[object Object],[object Object],[object Object],Deriving The Bresenham Line Algorithm (cont…)
The Bresenham Line Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Bresenham Line Algorithm (cont…) ,[object Object],[object Object],[object Object]
Bresenham Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bresenham Example (cont…) 17 16 15 14 13 12 11 10 18 29 27 26 25 24 23 22 21 20 28 30 k p k (x k+1 ,y k+1 ) 0 1 2 3 4 5 6 7 8 9
Bresenham Exercise ,[object Object]
Bresenham Exercise (cont…) 17 16 15 14 13 12 11 10 18 29 27 26 25 24 23 22 21 20 28 30 k p k (x k+1 ,y k+1 ) 0 1 2 3 4 5 6 7 8
Bresenham Line Algorithm Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Simple Circle Drawing Algorithm ,[object Object],[object Object],[object Object]
A Simple Circle Drawing Algorithm (cont…)
A Simple Circle Drawing Algorithm (cont…) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Eight-Way Symmetry ,[object Object],(x, y) (y, x) (y, -x) (x, -y) (-x, -y) (-y, -x) (-y, x) (-x, y)
Mid-Point Circle Algorithm ,[object Object],[object Object],The mid-point circle algorithm was developed by Jack Bresenham, who we heard about earlier. Bresenham’s patent for the algorithm can be viewed  here .
Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object],[object Object],( x k +1, y k ) ( x k +1, y k -1) ( x k , y k )
Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object]
Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object],[object Object]
Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object],[object Object]
Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object]
The Mid-Point Circle Algorithm ,[object Object],[object Object],[object Object],[object Object]
The Mid-Point Circle Algorithm (cont…) ,[object Object],[object Object],[object Object],[object Object]
Mid-Point Circle Algorithm Example ,[object Object]
Mid-Point Circle Algorithm Example (cont…) 9 7 6 5 4 3 2 1 0 8 9 7 6 5 4 3 2 1 0 8 10 10 k p k (x k+1 ,y k+1 ) 2x k+1 2y k+1 0 1 2 3 4 5 6
Mid-Point Circle Algorithm Exercise ,[object Object]
Mid-Point Circle Algorithm Example (cont…) k p k (x k+1 ,y k+1 ) 2x k+1 2y k+1 0 1 2 3 4 5 6 7 8 9 10 11 12 9 7 6 5 4 3 2 1 0 8 9 7 6 5 4 3 2 1 0 8 10 10 13 12 11 14 15 13 12 14 11 16 15 16
Mid-Point Circle Algorithm Summary ,[object Object],[object Object],[object Object]
Filling Polygons ,[object Object],[object Object],[object Object]
Scan-Line Polygon Fill Algorithm 2 4 6 8 10 Scan Line 0 2 4 6 8 10 12 14 16
Scan-Line Polygon Fill Algorithm ,[object Object],[object Object],[object Object],[object Object]
Scan-Line Polygon Fill Algorithm (cont…)
Line Drawing Summary ,[object Object],[object Object],[object Object],[object Object]
Anti-Aliasing
Summary Of Drawing Algorithms
Mid-Point Circle Algorithm (cont…) 6 2 3 4 1 5 4 3
Mid-Point Circle Algorithm (cont…) M 6 2 3 4 1 5 4 3
Mid-Point Circle Algorithm (cont…) M 6 2 3 4 1 5 4 3
Blank Grid
Blank Grid
Blank Grid 9 7 6 5 4 3 2 1 0 8 9 7 6 5 4 3 2 1 0 8 10 10
Blank Grid

Más contenido relacionado

La actualidad más candente

Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
Neha Kaurav
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
Mohd Arif
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
Mohd Arif
 

La actualidad más candente (20)

Anti aliasing,area sampling,koch curve and c curve
Anti aliasing,area sampling,koch curve and c curveAnti aliasing,area sampling,koch curve and c curve
Anti aliasing,area sampling,koch curve and c curve
 
Mid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing AlgorithmMid-Point Cirle Drawing Algorithm
Mid-Point Cirle Drawing Algorithm
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Line Detection
Line DetectionLine Detection
Line Detection
 
Applications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldApplications of Digital image processing in Medical Field
Applications of Digital image processing in Medical Field
 
Computer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and EllipseComputer Graphic - Lines, Circles and Ellipse
Computer Graphic - Lines, Circles and Ellipse
 
Graphics inputdevices
Graphics inputdevicesGraphics inputdevices
Graphics inputdevices
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I COM2304: Digital Image Fundamentals - I
COM2304: Digital Image Fundamentals - I
 
Computer animation
Computer animationComputer animation
Computer animation
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
3D Display
3D Display3D Display
3D Display
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Dda algorithm
Dda algorithmDda algorithm
Dda algorithm
 
DDA algorithm
DDA algorithmDDA algorithm
DDA algorithm
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 

Destacado

Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
Mohammad Sadiq
 
Bresenham's line algo.
Bresenham's line algo.Bresenham's line algo.
Bresenham's line algo.
Mohd Arif
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics Practical
Neha Sharma
 

Destacado (20)

Digital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing AlgorithmDigital Differential Analyzer Line Drawing Algorithm
Digital Differential Analyzer Line Drawing Algorithm
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Lab lecture 2 bresenham
Lab lecture 2 bresenhamLab lecture 2 bresenham
Lab lecture 2 bresenham
 
Bresenham circles and polygons derication
Bresenham circles and polygons dericationBresenham circles and polygons derication
Bresenham circles and polygons derication
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)bresenham circles and polygons in computer graphics(Computer graphics tutorials)
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
 
Lect14 lines+circles
Lect14 lines+circlesLect14 lines+circles
Lect14 lines+circles
 
Bresenhams
BresenhamsBresenhams
Bresenhams
 
Computer Graphics Programes
Computer Graphics ProgramesComputer Graphics Programes
Computer Graphics Programes
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
Two dimensional geometric transformation
Two dimensional geometric transformationTwo dimensional geometric transformation
Two dimensional geometric transformation
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of Pune
 
dda algorithm
dda  algorithmdda  algorithm
dda algorithm
 
Advanced Computer Aided Design ACAD
Advanced Computer Aided Design ACADAdvanced Computer Aided Design ACAD
Advanced Computer Aided Design ACAD
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Graphics Programming in C
Graphics Programming in CGraphics Programming in C
Graphics Programming in C
 
Bresenham's line algo.
Bresenham's line algo.Bresenham's line algo.
Bresenham's line algo.
 
Two dimentional transform
Two dimentional transformTwo dimentional transform
Two dimentional transform
 
2. fractal presentation
2. fractal presentation2. fractal presentation
2. fractal presentation
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics Practical
 

Similar a Graphics6 bresenham circlesandpolygons

Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygons
aa11bb11
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
RajJain516913
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimedia
saranyan75
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitives
saranyan75
 

Similar a Graphics6 bresenham circlesandpolygons (20)

Lecture-4-Scan_Conversion_Bresenhams_Algorithm.ppt
Lecture-4-Scan_Conversion_Bresenhams_Algorithm.pptLecture-4-Scan_Conversion_Bresenhams_Algorithm.ppt
Lecture-4-Scan_Conversion_Bresenhams_Algorithm.ppt
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
Bresenham circlesandpolygons
Bresenham circlesandpolygonsBresenham circlesandpolygons
Bresenham circlesandpolygons
 
Unit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithmsUnit-2 raster scan graphics,line,circle and polygon algorithms
Unit-2 raster scan graphics,line,circle and polygon algorithms
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
Computer graphics notes watermark
Computer graphics notes watermarkComputer graphics notes watermark
Computer graphics notes watermark
 
Unit 2
Unit 2Unit 2
Unit 2
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
module 1.pdf
module 1.pdfmodule 1.pdf
module 1.pdf
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Bresenhems line Genration derivation for Mtech
Bresenhems line Genration derivation for MtechBresenhems line Genration derivation for Mtech
Bresenhems line Genration derivation for Mtech
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniya
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
lecture 1.pptx
lecture 1.pptxlecture 1.pptx
lecture 1.pptx
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimedia
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitives
 

Más de Ketan Jani

Más de Ketan Jani (14)

08viewing3d
08viewing3d08viewing3d
08viewing3d
 
07object3d 1
07object3d 107object3d 1
07object3d 1
 
03raster 1
03raster 103raster 1
03raster 1
 
Shading
ShadingShading
Shading
 
Graphics pipeline
Graphics pipelineGraphics pipeline
Graphics pipeline
 
Curves
CurvesCurves
Curves
 
09transformation3d
09transformation3d09transformation3d
09transformation3d
 
07object3d
07object3d07object3d
07object3d
 
06 clipping
06 clipping06 clipping
06 clipping
 
05viewing2d
05viewing2d05viewing2d
05viewing2d
 
04transformation2d
04transformation2d04transformation2d
04transformation2d
 
03raster
03raster03raster
03raster
 
02mathematics 1
02mathematics 102mathematics 1
02mathematics 1
 
02mathematics
02mathematics02mathematics
02mathematics
 

Graphics6 bresenham circlesandpolygons