9/1/2023 0 Comments Dx select boxProgram to implement Bresenham's Line Drawing Algorithm: Step10: Draw a point of latest (x, y) coordinatesĮxample: Starting and Ending position of the line are (1, 1) and (8, 5). Step8: Calculate co-ordinates of the next pixel Step6: Generate point at (x,y)coordinates. Now consider the difference between these 2 distance values The distance from T to the actual line in y direction The distance from S to the actual line in y direction The actual y coordinates of the line at x = x i+1is To chooses the next one between the bottom pixel S and top pixel T. The line is best approximated by those pixels that fall the least distance from the path between P 1',P 2'. One top its right and up (upper-bound for the line).Either the one to its right (lower-bound for the line). In this method, next pixel selected is that one who has the least distance from true line.Īssume a pixel P 1'(x 1',y 1'),then select subsequent pixels as we work our may to the night, one pixel position at a time in the horizontal direction toward P 2'(x 2',y 2'). These operations can be performed very rapidly so lines can be generated quickly. It is an efficient method because it involves only integer addition, subtractions, and multiplication operations. This algorithm is used for scan converting a line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |