Rasterization: Polygon
Procedure
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.
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.
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.
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.
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.
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.
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.