Graphics /Build / DDA

DDA

goal

You will replace the direct line-height calculation inside your first-octant rasteriser with an incremental update. The output pixels should remain the same as before, but the loop will no longer calculate m*x + c in every column. Instead, it will keep the current floating-point line height yi as state, advance x by 1, add the constant slope m to yi, round that updated height, and draw the corresponding pixel. You should be able to trace both versions side by side and explain why they produce the same ideal y values.