Exemplify bresenham line generation algorithm by digitizing, Computer Graphics

Example: Exemplify the Bresenham line generation algorithm through digitizing the line along with end points (20, 10) and (30, 18)

Solution: m =    (y2 - y1)/( x2 - x1)

 =   (Δy) /(Δx)

=   (18 -10)/( 30 - 20)  = 0.8-------------------(1)

=> Δy = 8 and Δx = 10-------------------(2)

value of initial decision parameter (p0) = 2Δy - Δx= 2 * 8 - 10 = 6 -----------------(3) value of increments for calculating successive decision parameters are:

2Δy = 2 * 8 = 16;                                                  -------------------(4)

2Δy - 2Δx = 2 * 8 - 2 * 10 = - 4                          -------------------(5)

So plot first point (x0, y0) = (20, 10) in frame buffer at this time determine successive pixel positions beside line path from decision parameters value (20, 10).

k

0

pk

6

 

(xk + 1, yk + 1) (21, 11)

1

2

(22, 12)

2

- 2

(23, 12)

3

14

(24, 13)

4

10

(25, 14)

5

6

(26, 15)

6

2

(27, 16)

7

- 2

(28, 16)

8

14

(29, 17)

9

10

(30, 18)

 

 

← [use step (d) of algorithm Δ x times]

If pk > 0 then increase both X and Y

and pk  +1= pk + 2Δy - 2Δx

If pk < 0 then increase X and not Y

and pk + 1 = pk + 2Δy

 

Posted Date: 3/22/2013 7:39:52 AM | Location : United States







Related Discussions:- Exemplify bresenham line generation algorithm by digitizing, Assignment Help, Ask Question on Exemplify bresenham line generation algorithm by digitizing, Get Answer, Expert's Help, Exemplify bresenham line generation algorithm by digitizing Discussions

Write discussion on Exemplify bresenham line generation algorithm by digitizing
Your posts are moderated
Related Questions
Algorithms for Basic Line Segment Plotting There are two important algorithms for basic line segment plotting-DDA algorithm and Bresenham algorithm.  Both the algorithms use th

Translate a triangle and scale it in each coordinate direction Consider a triangle with vertices in 2D plane given by (0, 0), (1, 0) and (0,1) (called unit triangle).  Translat

Suppose here, one allows 256 depth value levels to be employed. Approximately how much memory would a 512x512 pixel display necessitate to store z-buffer? Solution : A system w

1. Compare Bresenham line generation with Digital Differential Analyzer line generation. Ans.   Bresenham line generation algorithm is better than Digital Differential Analyze

Art: it just like conventional animation, computer animation is additionally a type of art. A multitude of results can be created on a computer than on a piece of paper. An artist

Entertainment - Applications For Computer Animation Advertising, Games, Film, Video, Television, Multimedia are various of the entertainment fields wherein computer animation h

Traditional Animation techniques as: 1) Key Frames                        2) Cel Animation Formula: Required Key frames for a film = {[Time(in seconds)]

What Is Computer Graphics? The term Graphics mean is Graphical Tricks. All image or picture is actually a graph and when various mathematical tricks are utilized to manipulate

Persistence: How long they continue to emit light (that is, have excited electrons returning to the ground state) after the CRT beam is removed. Persistence is defined as the ti

Question 1 Explain Bresenham's Circle Drawing Algorithm Question 2 Derive the matrix for inverse transformation Question 3 Discuss the following Raster Graphic Algorithm