For the question by aevelson, I donâ€™t think it was discussed in lecture why using the diamond shape is visually more optimal than any other shape, but here are some of my own thoughts: To be fair in every direction and slop a line could be in, the most optimal shape to use should have rotational symmetry of the same order as the shape of the pixel(square), which is 4, or multiples of it. So shapes like triangles are not ideal. Among the other shapes why should we prefer the diamond? To render a line (that has no thickness) without without gaps or doubly thick parts I think any pixel being drawn should have exactly one adjacent pixel that is also drawn in each direction of the line. If we think of it this way, using diamonds is perfect because the edges of the diamonds of the four pixels surrounding a point form a square and that means the line will overlap with exactly two diamonds of the four adjacent pixels surrounding the same point. The same can not be said for circles or other shapes with more edges.

What happens when a line perfectly lies in between the adjacent pixels (line AB from the 2D cube rendering problem, for example)? Do we say that it passes through diamonds on both sides of the line?

@azul For this algorithm, we assume that the endpoints are integers; I think that there would be some sort of discretization/bucketing rule such that endpoints in between two pixels either correspond to one or the other. One thing we could do is just truncate the position, i.e. convert to int. Thus, if a horizontal line lies perfectly in between adjacent pixels in our representation, it would visually shift down to the center of the pixels below it.

Please log in to leave a comment.

What was the reason again that an inscribed diamond worked better than any other inscribed shape, such as a circle for example? I remember that the diamond corresponds to Bresenham's algorithm, but is there a reason it is visually optimal, as opposed to just computationally easier?