0% found this document useful (0 votes)
9 views

Chapter 2 (Part_1)_Scan Conversation

Uploaded by

raisulrifat25
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Chapter 2 (Part_1)_Scan Conversation

Uploaded by

raisulrifat25
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

Scan Conversation (Part 1)

Course Code: CSC 3224 Course Title: Computer Graphics

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 04 Week No: 03 Semester:


Lecturer:
Lecture Outline

1. What is Scan Conversation?


2. What is Rasterisation?
3. What is Incremental Algorithm?
4. Characteristics of Incremental Algorithm.
5. DDA Line Incremental Algorithm (Derivation)
6. DDA Line Incremental Algorithm (Mathematics)
7. Disadvantages of DDA Line Incremental Algorithm
8. Midpoint Line Algorithm (Derivation)
9. Midpoint Line Algorithm (Mathematics)
10. Advantages of Midpoint Line Algorithm
Scan Conversation

Modify as appropriate…..
Rasterisation

Rasterisation (or rasterization) is the task of taking an


image described in a vector graphics format (shapes)
and converting it into a raster image (pixels or dots) for
output on a video display or printer, or for storage in a
bitmap file format.
Incremental Algorithm

Incremental Algorithm is a line drawing


algorithm

Start from initial pixel to reach final pixel to


draw a line
Incremental Algorithm
Finding the next pixel
Incremental Algorithm
Requirements

Three Requirements:

Integer Pixel Grid


Slope
Disjoint Pixel
Incremental Algorithm
Integer Pixel Grid
Incremental Algorithm
Slope
Incremental Algorithm
Disjoint Pixel
Digital Differential Analyzer
(DDA)
Bresenham's Incremental Algorithm

In computer graphics, a digital differential analyzer


(DDA) is hardware or software used for interpolation
of variables over an interval between start and end
point. DDAs are used for rasterization of lines,
triangles and polygons.(graphics algorithm)
Digital Differential Analyzer
(DDA)
Derivation
Digital Differential Analyzer
(DDA)
Derivation (if m<1)
Digital Differential Analyzer
(DDA)
Derivation
Digital Differential Analyzer
(DDA)
Derivation (if m<1)
Digital Differential Analyzer
(DDA)
Derivation (if m<1)
Digital Differential Analyzer
(DDA)
Derivation (if m>1 and m=1)

if m>1
x1 = round(x + 1 /m)
y1 = y + 1

if m=1
x1=x+1
y1=y+1
Digital Differential Analyzer
(DDA)
Mathematics (Question)
Digital Differential Analyzer
(DDA)
Mathematics (Solve): Calculate Slope m and 1st Pixel
Digital Differential Analyzer
(DDA)
Mathematics (Solve): Calculate 2nd pixel
Digital Differential Analyzer
(DDA)
Mathematics (Solve): Calculate 3rd pixel
Digital Differential Analyzer
(DDA)
Mathematics (Solve): Calculate Final pixel
Digital Differential Analyzer
(DDA)
Disadvantages

• Floating point arithmetic in DDA algorithm is still time


consuming. The algorithm is orientation dependent. Hence
end point accuracy is poor.

• Although DDA is fast, the accumulation of round-off error in


successive additions of floating point increment, however
can cause the calculation pixel position to drift away from
the true line path for long line segment
Bresenham's Mid Point Line Algorithm
Introduction

The Midpoint line algorithm is an incremental line


plotting algorithm i.e. at each step we make incremental
calculations based on preceding step to find next y
value, in order to form a close approximation to a
straight line between two points.
Bresenham's Mid Point Line Algorithm
Concept
Bresenham's Mid Point Line Algorithm
Concept

Equation of Line:
y=mx+B

Function of Line:
F(x,y)= ax+by+c
Bresenham's Mid Point Line Algorithm
Derivation
Bresenham's Mid Point Line Algorithm
Derivation
Bresenham's Mid Point Line Algorithm
Derivation
Bresenham's Mid Point Line Algorithm
Derivation (Find Dstart)
Bresenham's Mid Point Line Algorithm
Derivation (Find Dstart)
Bresenham's Mid Point Line Algorithm
Derivation (How to Choose E / NE)
Bresenham's Mid Point Line Algorithm
Derivation (If E is chosen)
Bresenham's Mid Point Line Algorithm
Derivation (If E is chosen)
Bresenham's Mid Point Line Algorithm
Derivation (If NE is chosen)
Bresenham's Mid Point Line Algorithm
Derivation (Adjustment with value 2)
Bresenham's Mid Point Line Algorithm
Derivation (Summary)
Bresenham's Mid Point Line Algorithm
Advantages

• Incremental Method
• No Round Function
• More accurate position
• Only Arithmetic Function
Bresenham's Mid Point Line Algorithm
Mathematics : Question
Bresenham's Mid Point Line Algorithm
Mathematics: Solve
Bresenham's Mid Point Line Algorithm
Mathematics
Bresenham's Mid Point Line Algorithm
Mathematics
Bresenham's Mid Point Line Algorithm
Mathematics
Bresenham's Mid Point Line Algorithm
Mathematics
Books

• Foley, van Dam, Feiner, Hughes, Computer Graphics:


principles and practice, Addison Wesley, Second
Edition.
• Schaum's Outline of Theory & Problems of Computer
Graphics.
• Peter Shirley Steve Marschner , “Fundamental of
computer graphics”, Third Edition.
References

Chapter 3: Basic Raster Graphics Algorithm for Drawing 2D Primitives.


Foley, van Dam, Feiner, Hughes, Computer Graphics: principles and practice, 2 nd ed.

https://www.slideshare.net/mohammedarif89/intro-to-scan-conversion

https://en.wikipedia.org/wiki/Rasterisation

http://resources.mpi-inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/
CG16-RasterizationClipping.pdf

https://www.tutorialspoint.com/computer_graphics/line_generation_algorithm.htm

https://en.wikipedia.org/wiki/Digital_differential_analyzer_(graphics_algorithm)

https://www.slideshare.net/ManikanthKummarikunt/dda-algorithm-97720869

https://www.slideshare.net/drishtibhalla/mid-point-line-algorithm

https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

You might also like