This lecture explores Bresenham’s Midpoint Algorithm for generating discrete lines in computer graphics. We will discuss key concepts such as explicit and implicit line equations, constant slope, and the nature of discrete line segments. The focus will be on creating "good" discrete lines that minimize gaps and ensure smooth appearance and consistent pixel choices. Practical examples will illustrate the decision-making process using a logical variable that updates incrementally based on specific conditions. This essential algorithm is foundational for rendering lines in graphics applications.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Discrete Lines • Lines vs. Line Segments • What is a discrete line segment? • This is a relatively recent problem • How to generate a discrete line? CS 5600
“Good” Discrete Line - 1 • No gaps in adjacent pixels • Pixels close to ideal line • Consistent choices; same pixels in same situations CS 5600
“Good” Discrete Line - 2 • Smooth looking • Even brightness in all orientations • Same line for as for • Double pixels stacked up? CS 5600
Restricted Form • Line segment in first octant with 0 < m < 1 • Let us proceed CS 5600
Define a logical decision variable d linear in form incrementally updated (with addition) tells us whether to go E or NE Decision Variable d(logical) CS 5600
The Picture NE Q midpoint M idealline previous E CS 5600
Observe the relationships • Suppose Q is above M, as before. • Then , M is below the line • So, means line is above M, • Need to move NE, increasey value CS 5600
Observe the relationships • Suppose Q is below M, as before. • Then F(M) < 0 , implies M is above the line • So, F(M) < 0 , means line is below M, • Need to move to E; don’t increasey CS 5600
M= Midpoint = : • Want to evaluate at M • Will use an incr decision var d • Let, CS 5600
Summary • At each step of the procedure, we must choose between moving E or NE based on the sign of the decision variable d • Then update according to CS 5600