11 Mrs. Sadia Patka Dda Line Drawing Algorithm
11 Mrs. Sadia Patka Dda Line Drawing Algorithm
Prepared By:
Ms. Sadia Patka
Asst. Professor, CSE Dept.
SYLLABUS:
Unit 1: Introduction to Computer Graphics Overview of Computer
Graphics, Computer Graphics Application and Software, Graphics
Areas, Graphics Pipeline, Graphics API’s, Numerical issues, Efficiency
Display and Hardcopy Technologies, Display Technologies – Raster
scan Display System, Video Controller – Vector scan display system,
Random Scan Display Processor, Input Devices for Operator Interaction,
Image Scanners
Unit 2: Basic Raster Graphics Algorithms for Drawing 2D primitives,
aliasing and ant aliasing, Polygon filling methods: Scan Conversion
Algorithms: Simple Ordered edge list, Edge Fill, Fence fill and Edge
Flag Algorithm. ,Seed fill Algorithms: Simple and Scan Line Seed Fill
Algorithm, Halftoning techniques
Unit 3: Graphics Programming using OPENGL: Why OpenGL,
Features in OpenGL, OpenGL operations, Abstractions in OpenGL –
GL, GLU & GLUT, 3D viewing pipeline, viewing matrix specifications,
a few examples and demos of OpenGL programs, Animations in
openGL
Unit 4: 2D Clipping algorithms for regular and irregular windows:
Sutherland Cohen Outcode, Sutherland Cohen Subdivision, Mid-Point
subdivision, Cyrus Beck and Sutherland Hodgeman, Cohen-Sutherland
Polygon clipping Algorithm. Clipping about Concave regions. 2D
Transformations, Translation, Rotation, Reflection, Scaling, Shearing
Combined Transformation, Rotation and Reflection about an Arbitrary
Line
Unit 5: Normalized Device Coordinates and Viewing
Transformations, 3D System Basics and 3D Transformations, 3D
graphics projections, parallel, perspective, viewing transformations.
3D graphics hidden surfaces and line removal, painter’s algorithm,
Z -buffers, Warnock’s algorithm.
Unit 6: Basic Ray tracing Algorithm, Perspective, Computing
Viewing Rays, Ray-Object Intersection Shading, A Ray tracing
Program, Shadows, Ideal Specular Reflection. Curves and Surfaces:
Polygon Mesh, Parametric Cubic Curves, Parametric Bicubic
Surfaces, Quadratic Surface, Bezier Curves and B-spline curves.
COURSE OBJECTIVES:
1) The main objective of the course is to introduce students with
fundamental concepts and theory of computer graphics (CG).
2) It presents the important drawing algorithm, polygon fitting,
clipping and 2D transformation curves and an introduction to
3D transformation.
3) It provides the basics of OpenGL application programming
interface which allows students to develop programming
skills in CG.
COURSE OUTCOMES:
Upon the completion of the course students will be able to :-
CO1: Explain the applications, areas, and graphic pipeline, display
and hardcopy technologies.
CO2: Apply and compare the algorithms for drawing 2D images
also explain aliasing, anti aliasing and half toning techniques.
CO3: Discuss OpenGL application programming Interface and
apply it for 2D & 3D computer graphics.
CO4: Analyze and apply clipping algorithms and transformation on
2D images.
CO5: Solve the problems on viewing transformations and explain
the projection and hidden surface removal algorithms.
CO6: Explain basic ray tracing algorithm, shading, shadows, curves
and surfaces and also solve the problems of curves.
Digital Differenti al
Analyzer (DDA)
LINE DRAWING
ALGORITHM
WITH SOLVED EXAMPLES
DDA LINE DRAWING ALGORITHM
The line (vector) generation algorithms which determine the
pixels that should be turned ON are called as digital
differential analyzer (DDA).
It is one of the technique for obtaining a rasterized straight
line.
This algorithm can be used to draw the line in all the
quadrants.
DDA ALGORITHM
Assumption:
1.(x1, y1) and (x2, y2) are the two end points of a line and are
not equal.
2.Floor integer function is used to convert the real values into
integer value.
e.g.: if value is +8.5 then it is converted to 8 and
if value is -8.5 then it is converted to 9.
3. Sign function is used which returns +1, 0, -1 for the arguments
>0, =0, <0.
e.g.: sign(5) = +1 , sign(0) = 0,
sign(-1) = -1, sign (1) = 1
CONTD….