Drawing lines with Bresenham's Line Algorithm

前端 未结 3 1823
日久生厌
日久生厌 2021-01-04 23:00

My computer graphics homework is to implement OpenGL algorithms using only the ability to draw points.

So obviously I need to get drawLine() to work bef

3条回答
  •  伪装坚强ぢ
    2021-01-04 23:24

    In case anyone was wondering what the problem was, I still don't know what it was. What I ended up doing was re-factored my code so that the -shallow and -steep used the same algorithm as +shallow and +steep, respectively. After adjusting the x,y coordinates (negating the x or y coordinate), when I went to plot them I negated my original negation so that it plotted in the right spot.

提交回复
热议问题