Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
28 views
6 pages
pdf24 Images Merged
Jj
Uploaded by
cinematiccharm391
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save pdf24_images_merged For Later
Download
Save
Save pdf24_images_merged For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
28 views
6 pages
pdf24 Images Merged
Jj
Uploaded by
cinematiccharm391
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save pdf24_images_merged For Later
Carousel Previous
Carousel Next
Download
Save
Save pdf24_images_merged For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
COMPUTER GRAPHICS Advantages of Digital Differential Analyzer Itisa simple algorithm to implement. Itisa faster algorithm than the direct line equation. ‘We cannot use the multiplication method in Digital Differential Analyzer. Digital Differential Analyzer algorithm tells us about the overflow of the point when the point changes its location, Disadvantages of Digital Differential Analyzer ‘+ The floating-point arithmetic implementation of the Digital Differential Analyzer is time-consuming. ‘© The method of round-off is also time-consuming. ‘+ Sometimes the point position is not accurate Bresenham’s Line Drawing Algorithm This algorithm was introduced by “Jack Elton Bresenham” in 1962, This algorithm helps us to perform scan conversion of a line. It is a powerful, useful, and accurate method. We use incremental integer calculations to draw a line. The integer calculations include addition, subtraction, and multiplication, ‘In Bresenham’s Line Drawing algorithm, we have to calculate the slope (ma) between the starting point and the ending As shown inthe above figure let, we have inital coordinates of line = (Xy, Ys The next coondinates of a line = (as, Yast) The intersection point between ys and yur y. Let we assume that the distance between y and yy= dy, The distance between y and yxu1=ds Now. we have to decide which point i nearest to the intersection point. Mme I then x= xt { Unit Imerval) y=ytl { Unit Imerval} As we know the equation ofa line- y=mx+b [Now we put the value of x into the line equation, then an(ay+l) +b pa B ‘The value of d= y—y ‘Now we put the value of ds in equation 1). Dr. D. UDAYA/ Assistant Professor AAGASC / Department of Camputer Science / KKL %‘COMPUTER GRAPHICS ‘Then, a set {We will choose the nearest x. pivel} ‘The next coordinate will be (a+, yet) pc ‘Then, ar Me {We will choose the nearest x, pixel} ‘The next coordinate will be (x ye+1) Algorithin of Bresenham’s Line Drawing Algorithm ‘ow. we consider Starting point as (xt, ys) and ending point (x2, v2) jow, we have to calculate Ax and Ay. ‘Step 4: Now, we will calculate the decision parameter px with following formula. Pr 2ay, ‘Step 5: The initial coordinates ofthe line are (xa, yu), and the next coordinates are (xin, Yue). Now, we are going to ‘calculate two cases for decision parameter pa Case 1: If Porspet2ay pod PoaspetDay-2ax Neamt yea=yetl Step 6: We will repeat step 5 until we found the ending poimt ofthe line and the total number of iterations = Ax-1. ‘Step 7: Stop. ‘Example: A line has a starting point (9,18) and ending point (14,22). Apply the Bresenhuam’s Line Drawing algorithm to plota line. Solution: We hi Starting Point two coordinates, (x,y) = (418) ay =ye— Step 2: Now, we are going to calculate the decision parameter (Px) p= 2Ay- ax x4-5 ‘The value of px= 3 (ow, we will check both the cases. Step Dr. D. UDAYA / Assistant Professor ‘AAGASC / Department af Computer Science / KKLCOMPUTER GRAPHICS {OO —_———, o1?rseas 6 Fig, 2.2: - Pixel positions referenced by scan-line number and colurnn number. ‘© To load the specified color into the frame buffer at a particular position, we will assume we have available low-level procedure of the form setpixel(x, y) ‘+ Similarly for rettieve the current frame buffer intensity we assume to have procedure getpix(, ¥). Line Drawing Algorithms ‘The Line drawing algorithm is a graphical algorithm which is used to represent the line segment on diserete ‘graphical media, ic. printer and pixel-based media, ‘A line contains two points. The point is an important clement of a line. Properties of a Line Drawing Algorithm ‘There are the following properties of a good Line Drawing Algorithm, ‘+ Analgorithm should be precise: Each step of the algorithm must be adequately defined, Finiteness: An algorithm must contain finiteness, It means the algorithm stops after the execution of all steps Easy to understand; An algorithm must help learners to understand the solution in & more natural way. Correctness: An algorithm must be in the correct manner. Effectiveness: The steps of an algorithm must be valid and efficient. ‘Uniqueness: All steps of nn algorithm should be clearly and uniquely defined, and the result should be ‘based on the given input. Input: A good algorithm must accept atleast one or more input. © Output: An algorithm must generate at least one output ‘Equation of the straight line ‘We can define a straight line with the help of the following equation. ms +a Where, (x,y) = axis of the line 1m Slope ofthe line werception point Dr. 0. UDAYA// Assistant Professor AAGASC / Department of Computer Science / KKLCOMPUTER GRAPHICS. Step 3: We get m = 1, Third case is satisfied. Now move to next step. * y Bet Yea | OQae ye) 1 7 2 8 2.8) 3 9 G9 4 10 (4,10) 5 in sy 6 2 (6.12) 7 13 7.13) 8 4 14) 9 1s 9.15) 10 16 (10, 16) ut 7 ) Step 4: We will repeat step 3 until we get the endpoints of the line. Step 5: Stop. Ca) 24 6 8 1 1a te We ‘AAGASC / Department of Computer Science / KKLCOMPUTER GRAPHICS ‘+ Itis fast to apply but not faster than the Digital Differential Analyzer (DDA) algorithm. ‘+ The pointing accuracy is higher than the DDA algorithm. Disadvantages of Bresenham’s Line Drawing Algorit ‘+ The Bresenham’s Line drawing algorithm only helps to draw the basie line, ‘© The resulted draw line is not smooth, Circle generating algorithm Drawing a circle om the screen is a little complex than drawing a line. There are two popular algorithms for ‘generating a circle ~ Bresenham’s Algorithm and Midpoint Circle Algorithm. These algorithms are ‘based on the idea of determining the subsequent points required to draw the circle. Let us discuss the algorithms in detail — ‘The equation of circle is X2+Y2=12,X2+¥2=12, where ris radius ay (va) (ap) (ab) (ab) bea) Bresenham's Algorithm ‘We cannot display a continuous arc on the raster display. Instead, we have to choose the nearest pixel position to complete the arc. From the following illustration, you can see that we have put the pixel at X.YX.Y location and now need to decide where to put the next pixel ~ at NX+1,YX+1,¥ or at SX+1,¥~IX+1,.Y=1 +H) vet sertaet) om ‘This can be decided by the decision parameter d. + If d.<= 0, then NX+1,YX+1,Y is to be chosen as next pixel. + Ifd>0, then SX+1,Y-IX+1,Y~1 is to be chosen as the next pixel, Dr, D, UDAYA / Assistant Professor ‘AAGASC / Department of Computer Science / KKL‘COMPUTER GRAPHICS undied tine Attrinuton Lerren n the bunete tabhe Yor ine ttroutes on a pected workstation are Set with “set PotvlineRepresentation (wwe. HM. tw. Ke) erameter wt the morsstation Wentier and tine index perareter # defines the bbunde tao postion Parameter Rh, tr are then Gundled ang ausigned welues to set the ne tyEe, ne wth, and ine {Oo specications for designated ab'e index sctPotyinaneprasentation (1, 3, 2.0.8, 1) setPotytinenepresentation (4,3, 1,1, 7) A poly ine that is ausigned # table Index value of 3 would be daplayed using dashed tines at ha thickness in a ive color on work station 1: whe on woresation 4, ‘nis same index generates soba, stancero-sred white nes Bundle ares fl Attributes “Table entries for bunced avea-ti arerbtes are set with “setinteriorRepresentation (ws 8. pt fe) rics defes the atinbutes st cerresponding to fH index fon workstation wes Irarameter te Band Ware anangned vahaes forthe fi tye pattern inden and fi co. ‘Bundled Text Attributes ‘setTextRepresentation (ws, ti tf tp, te, ts, te) ‘Bundles values for text font, precision expansion factor size an coker io a table postion for work station ws that is specified by value assigned to text index parameter ti ‘Bundled marker Attributes setPolymarkerRepresentation (ws, mi, mt, ms, mc) ‘That defines marker type marker scale factor marker color for index mi on workstation ws. Inquiry Function Current settings for attributes and other parameters as workstanons types and status in the system lists can be retrieved with inquiry functions. inquirePoiylineindex ( tast) aod InquireinteriorcColourindex (laste) (Copy the current valves for line index and fil color nto parameter lasts and atte. Dr. D. UDAYA,/ Assistant Professor /AAGASC/Department of Computer Science / KKL
You might also like
Output Primitives
PDF
No ratings yet
Output Primitives
31 pages
CAD Practical 1
PDF
No ratings yet
CAD Practical 1
9 pages
Computer Graphics Lecture-1
PDF
No ratings yet
Computer Graphics Lecture-1
51 pages
Computer Graphics (CSE-435) : Lecture-1
PDF
No ratings yet
Computer Graphics (CSE-435) : Lecture-1
51 pages
Unit II CG
PDF
No ratings yet
Unit II CG
10 pages
Lecture topic 1.1.4
PDF
No ratings yet
Lecture topic 1.1.4
9 pages
Scan Conversion
PDF
No ratings yet
Scan Conversion
54 pages
Ch. 2 Scan Conversion
PDF
No ratings yet
Ch. 2 Scan Conversion
63 pages
2.raster Scan Algo
PDF
No ratings yet
2.raster Scan Algo
83 pages
UNIT3
PDF
No ratings yet
UNIT3
10 pages
Line Drawing Algorithm
PDF
No ratings yet
Line Drawing Algorithm
5 pages
Advantages and Disadv of DDA Algorithm
PDF
No ratings yet
Advantages and Disadv of DDA Algorithm
13 pages
Implementation Algorithms For Graphics Primitives and Attributes
PDF
No ratings yet
Implementation Algorithms For Graphics Primitives and Attributes
27 pages
Bresenhams Line Algorithm
PDF
No ratings yet
Bresenhams Line Algorithm
7 pages
Ass1 PDF
PDF
No ratings yet
Ass1 PDF
6 pages
Lecture02 Bresenham Line Algo
PDF
No ratings yet
Lecture02 Bresenham Line Algo
28 pages
Computer Graphics: (CODE: ECS-504)
PDF
No ratings yet
Computer Graphics: (CODE: ECS-504)
23 pages
Computer Graphics - Chapter 4 - 10
PDF
No ratings yet
Computer Graphics - Chapter 4 - 10
226 pages
cg
PDF
No ratings yet
cg
26 pages
Chapter 2 - Graphics Output Primitives
PDF
No ratings yet
Chapter 2 - Graphics Output Primitives
87 pages
DDA Line Drawing Algorithm-2
PDF
No ratings yet
DDA Line Drawing Algorithm-2
24 pages
C59 Exp1
PDF
No ratings yet
C59 Exp1
11 pages
Cg Chapter 4
PDF
No ratings yet
Cg Chapter 4
167 pages
CIT 2211 - Lecture 5 - Output Primitives
PDF
No ratings yet
CIT 2211 - Lecture 5 - Output Primitives
30 pages
Lecture 5 Output Primitives
PDF
No ratings yet
Lecture 5 Output Primitives
30 pages
Computer Graphics-drawing Algorithms
PDF
No ratings yet
Computer Graphics-drawing Algorithms
18 pages
FALLSEM2024-25 CSI3011 ETH VL2024250102817 2024-07-29 Reference-Material-I
PDF
No ratings yet
FALLSEM2024-25 CSI3011 ETH VL2024250102817 2024-07-29 Reference-Material-I
75 pages
Computer Graphics Bresenham Line Drawing Algorithm, Circle Drawing
PDF
No ratings yet
Computer Graphics Bresenham Line Drawing Algorithm, Circle Drawing
50 pages
2.raster Scan Algo
PDF
No ratings yet
2.raster Scan Algo
83 pages
My Line and Circle
PDF
No ratings yet
My Line and Circle
33 pages
UNIT 1 NOTES (1)
PDF
No ratings yet
UNIT 1 NOTES (1)
100 pages
Lecture 5 - Plotting Points and Lines
PDF
No ratings yet
Lecture 5 - Plotting Points and Lines
26 pages
Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling
PDF
No ratings yet
Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling
50 pages
Scan Conversion - Line
PDF
No ratings yet
Scan Conversion - Line
32 pages
Line Drawing Algo
PDF
No ratings yet
Line Drawing Algo
19 pages
Cgsem 4 PPT 2
PDF
No ratings yet
Cgsem 4 PPT 2
50 pages
Computer Graphics: (CO 313) (Lab File)
PDF
No ratings yet
Computer Graphics: (CO 313) (Lab File)
18 pages
Unit II Computer Graphics
PDF
No ratings yet
Unit II Computer Graphics
30 pages
Submitted To Submitted by Kunal Malik 4002: DR - Kiran Malik AP (CSE Dept.)
PDF
No ratings yet
Submitted To Submitted by Kunal Malik 4002: DR - Kiran Malik AP (CSE Dept.)
43 pages
Bresenham Algorithm
PDF
No ratings yet
Bresenham Algorithm
10 pages
Scan Conversion Algorithm
PDF
No ratings yet
Scan Conversion Algorithm
12 pages
2 chap cgr
PDF
No ratings yet
2 chap cgr
22 pages
Computer Graphics: (CO 313) (Lab File)
PDF
No ratings yet
Computer Graphics: (CO 313) (Lab File)
21 pages
Module 2
PDF
No ratings yet
Module 2
16 pages
Computer Graphics: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling
PDF
No ratings yet
Computer Graphics: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling
56 pages
Direct Use of Line Equation in Computer Graphics
PDF
No ratings yet
Direct Use of Line Equation in Computer Graphics
6 pages
Unit-3 Scan Line Conversion Algorithm
PDF
No ratings yet
Unit-3 Scan Line Conversion Algorithm
25 pages
CGM CH 2
PDF
No ratings yet
CGM CH 2
72 pages
Computer Graphics: Geometry and Line Generation
PDF
No ratings yet
Computer Graphics: Geometry and Line Generation
5 pages
CGR Unit 2
PDF
No ratings yet
CGR Unit 2
84 pages
Computer Graphics: (MC - 318) (Lab File)
PDF
No ratings yet
Computer Graphics: (MC - 318) (Lab File)
59 pages
Brese Nham Circles and Polygons
PDF
No ratings yet
Brese Nham Circles and Polygons
59 pages
Computer Graphics
PDF
No ratings yet
Computer Graphics
25 pages
Line Generation Algorithms
PDF
No ratings yet
Line Generation Algorithms
60 pages
CG Unit-1 Line Drawing Algs
PDF
No ratings yet
CG Unit-1 Line Drawing Algs
29 pages
Computer Graphics Module 1 Important Topics
PDF
No ratings yet
Computer Graphics Module 1 Important Topics
20 pages
Where To Draw A Line??
PDF
No ratings yet
Where To Draw A Line??
49 pages