Presentation On Line Drawing Algorithms
Presentation On Line Drawing Algorithms
DRAWING ALGORITHMS
BY;
DAISON DUCHE
LEE TERERAI GOMBE
TENDAI MAPIKU
INTRODUCTION
The aim of this presentation is to give you an overview and insight into line
drawing algorithms.
SCOPE
DEFINITIONS
DIRECT SCAN CONVERSION
DIGITAL DIFFERETIAL ANALYZER (DDA)
BRESENHAM’S ALGORITHM
CIRCLE DRAWING
ELLIPSE-GENERATING ALGORITHMS
CHARACTER GENERATION TECHNIQUE
DIRECT SCAN
CONVERSION
DIGITAL DIFFERETIAL
ANALYZER (DDA)
BRESENHAM’S
ALGORITHM
CIRCLE DRAWING
We know that the equation of a circle centered at the origin is x2 + y2 = R 2 ,
where (0, 0) is the origin R is the radius and (x, y) is any point on the circle.
x 2 + y2 = R2
y 2 = R2 – x 2
y = + √ (R 2 – x 2 )
To draw a quarter circle, we can increment x from 0 to R in unit steps, solving for
+y at each step. This method will work, but it is inefficient because of the multiply
and square root operations. Here the circle will have large gaps for values of x close
to R, because the slope of the circle becomes infinite there.
Eight-way symmetry
We can improve the process of the previous section by taking greater advantage of
the symmetry in a circle. Consider first a circle centered at the origin.
That is (0, 0). If the point (x, y) is on the circle the new
can trivially compute seven other points on the circle as
in a fig below;
Properties of Ellipses
An ellipse is defined as the set of points such that the sum of the distances from two
fixed positions (foci) is the same for all points (Fig. 1.40). If the distances to the two
foci from any point P = (x, y) on the ellipse are labeled dland d2, then the general
equation of an ellipse can be stated as
Expressing distances d1and d2interms of the focal coordinates F1 = (x1, y1)and F2=
(x2,y2), we have
By squaring this equation, isolating the remaining radical, and then squaring again,
we can rewrite the general ellipseequation in the form
An interactive method for specifying an ellipse in an arbitrary orientation is to input the two foci and a point
on the ellipse boundary. With these three coordinate positions, we can evaluate the constant in A. Then, the
coefficients in B can be evaluated and used to generate pixels along the elliptical path.
Ellipse equations are greatly simplified if the major and minor axes are oriented to align with the coordinate
axes. In Fig.1:41, we show an ellipse in "standard position" with major and minor axes oriented parallel to the
x and y axes. Parameter rx for this example labels the semi major axis, and parameter ry labels the semi
minor axis. The equation of the ellipse shown in Fig.1:42 can be written in terms of the ellipse center
coordinates and parameters rx and ry as
((x-xc)/rx) 2 +((y-yc)/ry) 2 =1 C
Using polar coordinates r and θ,we can also describe the ellipse in standard position with the parametric
equations:
x= xc+rxcosθ y= yc+rysinθ
Symmetry considerations can be used to further reduce computations. An ellipse in standard position is
symmetric between quadrants, but unlike a circle, it is not symmetric between the two octants of a
quadrant. Thus, we must calculate pixel positions along the elliptical arc throughout one quadrant, and then
we obtain positionsin the remaining three quadrants by symmetry
CHARACTER
GENERATION
TECHNIQUE
In computer graphics character can be generated using software.
In hardware implementation of character generation limited faces of
character can be generated.
A wide variety of faces of character can be generated with software
implementation.
There are three methods for generating characters using software
implementation:-
• Stroke method
• Vector method or bitmap method.
• Star bust method applications
Stroke Method
In this method we use a sequence of line drawing function and arc functions to
generate characters.
We can generate a sequence of character by assigning starting and end point of
line or arc.
By using this method various faces of character can be generated by changing the
values (parameters) in line and arc function.
Starbust Method
In this method a fixed pattern of line is used to generate the character.
In this method we use a combination of 24 bit line segment.
In 24 bit line segment code each bit represent a single line.
To highlight a line we put corresponding bit 1 in 24 bit line segment code and 0
otherwise.
Representation of Starbust Method:
Bitmap Method
This method is suitable for producing various character.
Font size of character can be increased by increasing the size of array.
This method uses an array of 1’s & 0’s to represent pixels
Example of an Bitmap Array:
Disadvantages
All the mentioned methods creates aliased characters:
In Starbust method, 24 bit segment code is required to put in memory for generating character.
Hence extra memory is required in this method .
Character quality is poor due to limited face.
THE END
DISCUSSION