Scan-line fill OpenGL/GLUT algorithm in C++

前端 未结 1 1805
谎友^
谎友^ 2020-12-17 00:31

I am trying to learn the scan-line fill algorithm implemented in OpenGL/GLUT. I cannot wrap my mind around the concept. Could anybody explain to me the algorithm in a reas

相关标签:
1条回答
  • 2020-12-17 01:18

    The scanfill function is filling the the pixels coverted by the 4-sided polygon described by the four x-y coordinates. To do this, it uses the edgedetect function, which simulates drawing the edges of the polygon and remembers the minimum and maximum x coordinate for each y coordinate. The scanfill function then goes through each y coordinate and draws a horizontal line of pixels across the remembered range.

    0 讨论(0)
提交回复
热议问题