Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4 Graphic Primitives, Circle. Drawing Circles.

Similar presentations


Presentation on theme: "Lecture 4 Graphic Primitives, Circle. Drawing Circles."— Presentation transcript:

1 Lecture 4 Graphic Primitives, Circle

2 Drawing Circles

3 Brute Force Method

4 Cheating with 8 arcs

5 Cheating with 8 arcs Implementation

6

7 Digital Differential Analysis - An incremental algorithm Does not require sine or cosine table. based upon calculating the gradient of a circle at a point and using that to approximate the position of the next point.

8 Digital Differential Analysis - An incremental algorithm

9 Digital Differential Analysis - Implementation

10 Bresenham’s algorithm for circles Based on limiting the choice of the next pixel to be plotted to two alternatives, then creating and testing a decision variable to determine which alternative is actually plotted. D(Si) and D(Ti) represent the differences between the squared distance between the center of the circle and the middle of pixels S and T. Whichever is smallest corresponds to the pixel that should be plotted. To combine the two calculations into one “decision variable” is simply a matter of subtracting the two expressions:

11 Bresenham’s algorithm for circles

12 Implementation for Bresenham’s algorithm

13 Implementation for circles

14

15


Download ppt "Lecture 4 Graphic Primitives, Circle. Drawing Circles."

Similar presentations


Ads by Google