SlideShare a Scribd company logo
1. Scan Conversion
-It is a process of representing graphics objects a collection of pixels. & here
graphics objects are continuous. The pixels used are discrete. Each pixel can
have either on or off state. 0 is represented by pixel off. 1 is represented using
pixel on. Using this ability graphics computer represent picture having discrete
dots.
Advantage of developing algorithms for scan conversion
1. Algorithms can generate graphics objects at a faster rate.
2. Using algorithms memory can be used efficiently.
3. Algorithms can develop a higher level of graphical objects.
The process of converting is also called as rasterization.
● It is converting a vector image (a mathematically defined image of points
and curves) to a raster image (a picture composed of discrete pixels).
● Rasterization is commonly used in real-time 3D graphics processing to
convert images quickly for display on a computer monitor.
Examples of objects which can be scan converted
1. Point
2. Line
3. Sector
4. Arc
5. Ellipse
6. Rectangle
7. Polygon
8. Characters
9. Filled Regions
1.Scan Converting a Straight Line
A straight line may be defined by two endpoints & an equation. The equation of
the line is used to determine the x, y coordinates of all the points that lie between
these two endpoints.
Equation of a straight line, y = mx + b
Using the equation of a straight line, y = mx + b where
m = = (y2-y1) / (x2-x1)
b = the y intercept
Properties of Good Line Drawing Algorithm
1. Line should appear Straight: We must appropriate the line by choosing
addressable points close to it. If we choose well, the line will appear straight,
if not, we shall produce crossed lines.
2. Lines should terminate accurately: Unless lines are plotted accurately, they
may terminate at the wrong place.
3. Lines should have constant density: Line density is proportional to the no. of
dots displayed divided by the length of the line.
To maintain constant density, dots should be equally spaced.
4. Line density should be independent of line length and angle
5. Line should be drawn rapidly
Algorithm for line Drawing
1. DDA (Digital Differential Analyzer)
2. Bresenham's Algorithm
1) DDA (Digital Differential Analyzer)
-DDA stands for Digital Differential Analyzer. It is an incremental method of scan
conversion of line. In this method calculation is performed at each step but by using results
of previous steps.
-Here difference in pixel point is to be analyzed according to that line can be drawn.
y=mx+b
m=(y2-y1)/(x2-x1)
m= dy/dx ……... (DDA algorithm is based on calculation of these values dy & dx)
DDAAlgorithm
Step1: Start Algorithm
Step2: Declare x1,y1,x2,y2,dx,dy,x,y as integer variables...(here we have declared
all values that requires for calculations)
Step3: accepting value of x1,y1,x2,y2.(means we are accepting our starting &
ending points of line )
Step4: Calculate dx = x2-xl (here we are find out horizontal difference between end points)
Step5: Calculate dy = y2-y1 (here we are find out vertical difference between end points)
Step6: If ABS (dx) > ABS (dy)
Then step = abs (dx) (here we are finding value of step)
else step = abs (dy)
Step7: x inc= dx/step (here we are calculating value of x increment )
yinc= dy / step (here we are calculating value of y increment )
assign x = x1
assign y = y1
Step 8: Set pixel (x, y) (setting values of x & y pixel)
Step 9: Xnew = Xold + x inc (here we are goint to find out new value for x & we know value of x increment & old value
of x already) Ynew = Yold + yinc (here we are goint to find out new value for y & we know value of y increment &
old value of y already)
Set pixels (Round (x), Round (y)).......(here setting new values of x & y pixel, & we are
rounding the values becoz for calculation purpose we are using original value but for display
purpose we are rounding values)
Step 10: Repeat step 9 until x = x2
Step 11: End Algorithm.
Example 1 : Plot a line using DDA line generation algorithm from p1 (1,1) to p2 (5,3)
Solution : here x1=1, y1=1 & x2=5, y2=3
Dx = (x2-x1) = (5-1) = 4
Dy = (y2-y1) = (3-1) = 2
as |Dx| > |Dy|
step = abs(Dx) = 4
x inc= dx/step =4/4 = 1
y inc= dy / step = 2/4 = 0.5
first point we know that is (x1,y1) so plot it
Xnew = Xold +x inc Ynew = Yold + y inc
Xnew =1 + 1=2 Ynew = 1 + 0.5 = 1.5
Xnew = 2 Ynew = 2
For next iteration
xnew = Xold + x inc Ynew = Yold +y inc
Xnew = 2 + 1 Ynew = 1.5 + 0.5
Xnew = 3 Ynew = 2
after calculating values ,after 5 loops , we will get line as using plot values
values as below
I X Y Plot
1. 1 1 (1,1)
2. 2 2 (2,2)
3. 3 2 (3,2)
4. 4 3 (4,3)
5. 5 3 (5,3)
Example 2 : Plot a line using DDA line generation algorithm from p1 (5,8) to p2 (9,5)
Solution : here x1 = 5, y1 = 8 & x2 = 9, y2 = 5
Dx = (x2-x1) = (9-5) = 4
Dy = (y2-y1) = (5-8) = -3
as |Dx| > |Dy|
step = abs(Dx) = 4
x inc= dx/step =4/4 = 1
y inc= dy / step = -3/4 = -0.75
First point we know that is (x1,y1) so plot it
Xnew = Xold +x inc Ynew = Yold + y inc
Xnew =5 + 1=6 Ynew = 8 + (-0.75) = 7.25
Xnew = 6 Ynew = 7
For next iteration
xnew = Xold + x inc Ynew = Yold +y inc
Xnew = 6 + 1 Ynew = 7.25 +(- 0.75)
Xnew = 7 Ynew = 6.50 = 7
after calculating values ,after 5 loops , we will get line as using plot values
values as below
I X Y Plot
1. 5 8 (5 ,8)
2. 6 7 (6 ,7)
3. 7 7 (7 ,7)
4. 8 6 (8 ,6)
5. 9 5 (9 ,5)
Advantage:
-It is a faster method
-It allows us to detect the change in the value of x and y ,so plotting of same point twice is
not possible.
-It is an easy method because each step involves just two additions.
Disadvantage:
-Rounding off operations and floating point operations consumes a lot of time.
Thank you !!
1) DDA (Digital Differential Analyzer)
-DDA stands for Digital Differential Analyzer. It is an incremental method of scan conversion of
line. In this method calculation is performed at each step but by using results of previous steps.
-Here difference in pixel point is to be analyzed according to that line can be drawn.
y=mx+b
m=(y2-y1)/(x2-x1)
m= dy/dx ……... (DDA algorithm is based on calculation of these values dx & dy)
There are three cases
i) m<1 ii) m>1 iii) m=1
Xn=x1+1 Xn=x1+1 /m Xn=x1+1
Yn=y1+m Yn=y1+1 Yn=y1+1
Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar

More Related Content

What's hot

Dda algo notes
Dda algo notesDda algo notes
Dda algo notes
shreeja asopa
 
DDA (digital differential analyzer)
DDA (digital differential analyzer)DDA (digital differential analyzer)
DDA (digital differential analyzer)
Inamul Hossain Imran
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
PrathimaBaliga
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
Ruchi Maurya
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algo
simpleok
 
Lect3cg2011
Lect3cg2011Lect3cg2011
Lect3cg2011
ishusharma6098
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
Maaz Rizwan
 
Bresenham algorithm
Bresenham algorithmBresenham algorithm
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
aravindangc
 
Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer Graphics
Drishti Bhalla
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
Mohammad Sadiq
 
COMPUTER GRAPHICS
COMPUTER GRAPHICSCOMPUTER GRAPHICS
COMPUTER GRAPHICS
Jagan Raja
 
Lect14 lines+circles
Lect14 lines+circlesLect14 lines+circles
Lect14 lines+circles
Siddharth Maloo
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
Ciaran Cox
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1
ankuredkie
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
Prabin Gautam
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
Mohd Arif
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
Surya Sukumaran
 
computer graphics-C/C++-dancingdollcode
computer graphics-C/C++-dancingdollcodecomputer graphics-C/C++-dancingdollcode
computer graphics-C/C++-dancingdollcode
Bhavya Chawla
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
nehrurevathy
 

What's hot (20)

Dda algo notes
Dda algo notesDda algo notes
Dda algo notes
 
DDA (digital differential analyzer)
DDA (digital differential analyzer)DDA (digital differential analyzer)
DDA (digital differential analyzer)
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 
Computer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithmComputer graphics - bresenham line drawing algorithm
Computer graphics - bresenham line drawing algorithm
 
Lab lecture 1 line_algo
Lab lecture 1 line_algoLab lecture 1 line_algo
Lab lecture 1 line_algo
 
Lect3cg2011
Lect3cg2011Lect3cg2011
Lect3cg2011
 
Lec02 03 rasterization
Lec02 03 rasterizationLec02 03 rasterization
Lec02 03 rasterization
 
Bresenham algorithm
Bresenham algorithmBresenham algorithm
Bresenham algorithm
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Mid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer GraphicsMid point line Algorithm - Computer Graphics
Mid point line Algorithm - Computer Graphics
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
COMPUTER GRAPHICS
COMPUTER GRAPHICSCOMPUTER GRAPHICS
COMPUTER GRAPHICS
 
Lect14 lines+circles
Lect14 lines+circlesLect14 lines+circles
Lect14 lines+circles
 
Assignment 1
Assignment 1Assignment 1
Assignment 1
 
A Tutorial On Ip 1
A Tutorial On Ip 1A Tutorial On Ip 1
A Tutorial On Ip 1
 
Computer graphics 2
Computer graphics 2Computer graphics 2
Computer graphics 2
 
Intro to scan conversion
Intro to scan conversionIntro to scan conversion
Intro to scan conversion
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
computer graphics-C/C++-dancingdollcode
computer graphics-C/C++-dancingdollcodecomputer graphics-C/C++-dancingdollcode
computer graphics-C/C++-dancingdollcode
 
Bresenham's line drawing algorithm
Bresenham's line drawing algorithmBresenham's line drawing algorithm
Bresenham's line drawing algorithm
 

Similar to Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar

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
ssuser255bf1
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
meenasp
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
Omprakash Chauhan
 
Study on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan GraphicsStudy on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan Graphics
Chandrakant Divate
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
Mattupallipardhu
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
SanthiNivas
 
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
RAJARATNAS
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
Kokebe2
 
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
Amol Gaikwad
 
99995320.ppt
99995320.ppt99995320.ppt
99995320.ppt
MohdSaqib79
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
Diksha Trivedi
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
54MahakBansal
 
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
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
Kamal Acharya
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
module 1.pdf
module 1.pdfmodule 1.pdf
module 1.pdf
KimTaehyung188352
 
Rasterization.pptx
Rasterization.pptxRasterization.pptx
Rasterization.pptx
AhmadAbba6
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Unit 2
Unit 2Unit 2
Unit 2
ypnrao
 
Primitives
PrimitivesPrimitives

Similar to Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar (20)

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
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
Study on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan GraphicsStudy on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan Graphics
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
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
 
Chapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptxChapter 3 - Part 1 [Autosaved].pptx
Chapter 3 - Part 1 [Autosaved].pptx
 
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
 
99995320.ppt
99995320.ppt99995320.ppt
99995320.ppt
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdfCD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
CD504 CGM_Lab Manual_004e08d3838702ed11fc6d03cc82f7be.pdf
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
module 1.pdf
module 1.pdfmodule 1.pdf
module 1.pdf
 
Rasterization.pptx
Rasterization.pptxRasterization.pptx
Rasterization.pptx
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Unit 2
Unit 2Unit 2
Unit 2
 
Primitives
PrimitivesPrimitives
Primitives
 

Recently uploaded

S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 

Computer Graphics - Introduction in Brief By: Prof. Manisha Waghmare- Butkar

  • 1. 1. Scan Conversion -It is a process of representing graphics objects a collection of pixels. & here graphics objects are continuous. The pixels used are discrete. Each pixel can have either on or off state. 0 is represented by pixel off. 1 is represented using pixel on. Using this ability graphics computer represent picture having discrete dots.
  • 2.
  • 3. Advantage of developing algorithms for scan conversion 1. Algorithms can generate graphics objects at a faster rate. 2. Using algorithms memory can be used efficiently. 3. Algorithms can develop a higher level of graphical objects.
  • 4. The process of converting is also called as rasterization. ● It is converting a vector image (a mathematically defined image of points and curves) to a raster image (a picture composed of discrete pixels). ● Rasterization is commonly used in real-time 3D graphics processing to convert images quickly for display on a computer monitor.
  • 5. Examples of objects which can be scan converted 1. Point 2. Line 3. Sector 4. Arc 5. Ellipse 6. Rectangle 7. Polygon 8. Characters 9. Filled Regions
  • 6. 1.Scan Converting a Straight Line A straight line may be defined by two endpoints & an equation. The equation of the line is used to determine the x, y coordinates of all the points that lie between these two endpoints.
  • 7. Equation of a straight line, y = mx + b Using the equation of a straight line, y = mx + b where m = = (y2-y1) / (x2-x1) b = the y intercept
  • 8.
  • 9. Properties of Good Line Drawing Algorithm 1. Line should appear Straight: We must appropriate the line by choosing addressable points close to it. If we choose well, the line will appear straight, if not, we shall produce crossed lines.
  • 10. 2. Lines should terminate accurately: Unless lines are plotted accurately, they may terminate at the wrong place. 3. Lines should have constant density: Line density is proportional to the no. of dots displayed divided by the length of the line. To maintain constant density, dots should be equally spaced.
  • 11. 4. Line density should be independent of line length and angle 5. Line should be drawn rapidly
  • 12. Algorithm for line Drawing 1. DDA (Digital Differential Analyzer) 2. Bresenham's Algorithm
  • 13. 1) DDA (Digital Differential Analyzer) -DDA stands for Digital Differential Analyzer. It is an incremental method of scan conversion of line. In this method calculation is performed at each step but by using results of previous steps. -Here difference in pixel point is to be analyzed according to that line can be drawn. y=mx+b m=(y2-y1)/(x2-x1) m= dy/dx ……... (DDA algorithm is based on calculation of these values dy & dx)
  • 14.
  • 15. DDAAlgorithm Step1: Start Algorithm Step2: Declare x1,y1,x2,y2,dx,dy,x,y as integer variables...(here we have declared all values that requires for calculations) Step3: accepting value of x1,y1,x2,y2.(means we are accepting our starting & ending points of line ) Step4: Calculate dx = x2-xl (here we are find out horizontal difference between end points) Step5: Calculate dy = y2-y1 (here we are find out vertical difference between end points) Step6: If ABS (dx) > ABS (dy) Then step = abs (dx) (here we are finding value of step) else step = abs (dy)
  • 16. Step7: x inc= dx/step (here we are calculating value of x increment ) yinc= dy / step (here we are calculating value of y increment ) assign x = x1 assign y = y1 Step 8: Set pixel (x, y) (setting values of x & y pixel) Step 9: Xnew = Xold + x inc (here we are goint to find out new value for x & we know value of x increment & old value of x already) Ynew = Yold + yinc (here we are goint to find out new value for y & we know value of y increment & old value of y already) Set pixels (Round (x), Round (y)).......(here setting new values of x & y pixel, & we are rounding the values becoz for calculation purpose we are using original value but for display purpose we are rounding values) Step 10: Repeat step 9 until x = x2 Step 11: End Algorithm.
  • 17. Example 1 : Plot a line using DDA line generation algorithm from p1 (1,1) to p2 (5,3) Solution : here x1=1, y1=1 & x2=5, y2=3 Dx = (x2-x1) = (5-1) = 4 Dy = (y2-y1) = (3-1) = 2 as |Dx| > |Dy| step = abs(Dx) = 4 x inc= dx/step =4/4 = 1 y inc= dy / step = 2/4 = 0.5 first point we know that is (x1,y1) so plot it Xnew = Xold +x inc Ynew = Yold + y inc Xnew =1 + 1=2 Ynew = 1 + 0.5 = 1.5 Xnew = 2 Ynew = 2
  • 18. For next iteration xnew = Xold + x inc Ynew = Yold +y inc Xnew = 2 + 1 Ynew = 1.5 + 0.5 Xnew = 3 Ynew = 2 after calculating values ,after 5 loops , we will get line as using plot values values as below I X Y Plot 1. 1 1 (1,1) 2. 2 2 (2,2) 3. 3 2 (3,2) 4. 4 3 (4,3) 5. 5 3 (5,3)
  • 19. Example 2 : Plot a line using DDA line generation algorithm from p1 (5,8) to p2 (9,5) Solution : here x1 = 5, y1 = 8 & x2 = 9, y2 = 5 Dx = (x2-x1) = (9-5) = 4 Dy = (y2-y1) = (5-8) = -3 as |Dx| > |Dy| step = abs(Dx) = 4 x inc= dx/step =4/4 = 1 y inc= dy / step = -3/4 = -0.75 First point we know that is (x1,y1) so plot it Xnew = Xold +x inc Ynew = Yold + y inc Xnew =5 + 1=6 Ynew = 8 + (-0.75) = 7.25 Xnew = 6 Ynew = 7
  • 20. For next iteration xnew = Xold + x inc Ynew = Yold +y inc Xnew = 6 + 1 Ynew = 7.25 +(- 0.75) Xnew = 7 Ynew = 6.50 = 7 after calculating values ,after 5 loops , we will get line as using plot values values as below I X Y Plot 1. 5 8 (5 ,8) 2. 6 7 (6 ,7) 3. 7 7 (7 ,7) 4. 8 6 (8 ,6) 5. 9 5 (9 ,5)
  • 21. Advantage: -It is a faster method -It allows us to detect the change in the value of x and y ,so plotting of same point twice is not possible. -It is an easy method because each step involves just two additions. Disadvantage: -Rounding off operations and floating point operations consumes a lot of time.
  • 23. 1) DDA (Digital Differential Analyzer) -DDA stands for Digital Differential Analyzer. It is an incremental method of scan conversion of line. In this method calculation is performed at each step but by using results of previous steps. -Here difference in pixel point is to be analyzed according to that line can be drawn. y=mx+b m=(y2-y1)/(x2-x1) m= dy/dx ……... (DDA algorithm is based on calculation of these values dx & dy) There are three cases i) m<1 ii) m>1 iii) m=1 Xn=x1+1 Xn=x1+1 /m Xn=x1+1 Yn=y1+m Yn=y1+1 Yn=y1+1