Primitive Line Drawing Algorthms Flashcards

1
Q

What is DDA?

A

Digital difference analyzer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the basic idea of DDA?

A

To calculate x or y by looking at delta x or delta y sampled at unit intervals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Bresenham’s Algorithm?

A

An algorithm to calculate a line using only integer math.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the five steps of Bresenham’s Algorithm?

A
  1. Get endpoints, left endpoints (x0, y0)
  2. Plot (x0, y0)
  3. Calculate constants, dx, dy, 2dy, 2dy-2dx, decision parameter p0 = 2dy-dx.
  4. fpr each x if p < 0 go east and p = p + 2dy if p > 0 go northeast and p = p + 2dy - 2dx.
  5. Repeat 4 until done.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly