Академический Документы
Профессиональный Документы
Культура Документы
Lecture-00
Jesmin Akhter
Lecturer,IIT
Jahangirnagar University,
Savar, Dhaka,Bangladesh
07/28/16
Course Overview
Tutorial 01
Introduction(L00)
Scan Conversion(L01+L02+L03)
2.5
Sets
2 Sets
1.5
Sets
1 Set
Course Policy
No late homework is acceptable.
Cheating directly affects the reputation
of Department and the University and
lowers the morale of other students.
Cheating in homework and exam will not
be tolerated.
An automatic grade of 0 will be assigned
for any student caught cheating.
Presenting another persons work as
your own constitutes cheating.
Primary Focus
Develop thinking ability.
problem solving skills.
formal thinking.
Goals
Be very familiar with a collection of
Computer Graphics algorithms.
Be intimately familiar with mathematics for
Computer Graphics
Be able to apply techniques in practical
problems.
Intro 5
07/28/16
Scan Conversion
Graphics System convert
each primitive(points ,lines, circles,
ellipses etc.) from its geometric
definition into a set of pixels that make
up the picture in the image space.
This Conversion task is referred to as
Scan Conversion.
p2(x2,y2)
p1(x1,y1)
y1andy 2,
value of x using
the equation and scan convert (x,y).
DDA Algorithm
yi 1 yi mx
or
xi 1 xi y / m
DDA Algorithm
Desired
Line
(xi+1,
Round(yj+m))
(xi, yj)
(xi+1, yj+m)
(xi, Round(yj))
y2
y1
x1
x2
DDA Algorithm
DDA (Digital Differential Analyzer)
Assume 0 m 1 .
yi 1 mxi 1 B
m( xi x) B
yi mx
yi 1 yi m
x 1
(xi,Round(yi+m))
Desired Line
(xi,yi)
(xi,Round(yi))
(xi,yi +m)
void Line(int x0, int y0, int x1, int y1, int value) {
double y = y0;
double m = (y1 y0) / (x1 x0);
// 0 <= m <= 1
for (int x = x0; x <= x1; x++) {
WritePixel(x, Round(y), value);
y += m;
}
Require to eliminate floating point operations & variables
}
DDA ALGORITHM