Computer Graphics and Multimedia Systems SCS1302: Unit 1
Computer Graphics and Multimedia Systems SCS1302: Unit 1
Multimedia Systems
SCS1302
Unit 1
Syllabus
08/02/2021 2018 - 2022 19
08/02/2021 2018 - 2022 20
08/02/2021 2018 - 2022 21
Example 3
Calculate the points between the starting point (5, 6) and
ending point (13, 10).
Given-
• Starting coordinates = (X0, Y0) = (5, 6)
• Ending coordinates = (Xn, Yn) = (13, 10)
Step-01:
• Calculate ΔX, ΔY and M from the given input.
• ΔX = Xn – X0 = 13 – 5 = 8
• ΔY =Yn – Y0 = 10 – 6 = 4
• M = ΔY / ΔX = 4 / 8 = 0.50
If(20>30)
{ x=20; y=10; xend=30; }
setpixel(20,10);
while(20<30)
{ x=21;
If(6<0)
y=11;
p=6-4 = 2;
}
setpixel(21,11);
0 6 (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 08/02/2021
10 (30,18)
2018 - 2022 45
Example 1- Bresenhams Line drawing
The disadvantage of such a simple algorithm is that it is meant for basic line drawing. The "advanced"
topic of antialiasing isn't part of Bresenham's algorithm, so to draw smooth lines, you'd want to look
into a different algorithm.