Rasterization: Polygon

Procedure

  1. Draw the Polygon:

    • Click on the canvas to place the vertices and form a polygon.
    • To complete the polygon, click near the first vertex to close the shape.
    • The coordinates of each vertex will be displayed in the Vertex Coordinates section.
  2. Edit the Vertices:

    • To adjust any vertex, hold the left mouse button on a vertex and drag it to the desired location.
    • Alternatively, click the x and y coordinates in the Vertex Coordinates section to manually edit the position of the vertex.
  3. Start the Fill Process:

    • Once the polygon is complete, click the Start Fill button to begin the Scan Line Fill simulation.
    • The algorithm will begin calculating intersection points for each scan line.
  4. Control Iterations:

    • Use the Next Step button to move to the next iteration of the algorithm. You can speed up the simulation by holding down the button.
    • Click the Clear Canvas button to reset the canvas and start over.
  5. Answer the Question:

    • During the simulation, a question will appear in a modal. You must answer correctly to continue.
    • If the answer is incorrect, the modal will remain open, and you can retry until you answer correctly.
  6. Track Progress:

    • The Algorithm Progress section on the right will display the current step of the simulation, showing details about active edges and intersection points.
  7. Repeat with New Vertices:

    • After the experiment concludes, you can experiment again with new sets of vertices by drawing a new polygon on the canvas and starting the process again.