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
Question : You have been approached to design a ‘tuck top auto-lock bottom' carton package for a high-end cosmetic jar under the brand name ‘Beauty One'. Your client asked you

Types of Formats It is significant to distinguish among a file format and a codec. Although most audio file formats support merely one audio codec, a file format may assist mul

Reflection and Types of Reflection Reflection and its types:   Reflection: this is the phenomenon of bouncing back of light; such phenomenon obeys laws of Reflec

What is a spline?  To produce a smooth curve by a designed set of points, a flexible strip called spline is used. Like spline curve can be mathematically explained with a piece

QUESTION a) Explain with the help of a diagram, how a thermal inkjet printer works. b) Briefly explain the term density range. c) Distinguish between scaling and resampli

Summary of Graphic Primitives In this all section, we have illustrated the basic graphic primitives that are line, point and circle; we have also illustrated both practical an

QUESTION a) Differentiate between raster and vector images. b) Explain the concept of bit depth. What is the minimum number if bits required for a one-colour digital image t

Perspective Projection 1. Perspective projection gives more realistic appearance and uses the same principle as used in camera. 2. Perspective projection is not an affine tr

Discuss in detail about rendering Computer animation uses a technique termed as avars (animation variable) where starting point is generally a series of stick figures; for exam

Anti Aliasing - Modeling and Rendering It is a method for enhancing the realism of an image through eliminating the jagged edges from it. Such jagged edges or "jaggies", appe