Clipping: Polygon
Procedure: Sutherland-Hodgman Polygon Clipping Experiment
Step 1: Initial Setup
- Open the simulation page
- You will see:
- A canvas area on the left
- Input controls on the right
- Navigation buttons at the bottom
Step 2: Configure Clipping Window
- Locate the "Clipping Window" section
- Enter coordinates for:
- Top Left Corner
- Bottom Right Corner
- Default values are provided for quick start
Step 3: Define Polygon
- Find the "Polygon Points" section
- Enter coordinates for 5 points:
- Point 1
- Point 2
- Point 3
- Point 4
- Point 5
- Default values are available
Step 4: Start Simulation
- Click the "Submit" button
- Observe:
- Pink rectangle showing clipping window
- Yellow dots and lines showing initial polygon
- Coordinate labels for each vertex
Step 5: Run the Experiment
Click "Next" to progress through steps:
- Initial polygon state
- After left edge clipping
- After top edge clipping
- After right edge clipping
- After bottom edge clipping
- Final clipped polygon
At each step, observe:
- Yellow dots: Current vertices
- Yellow lines: Current edges
- White lines: Final clipped polygon
- Intermediate Vertices panel: Current vertex coordinates
Step 6: Navigation
- Use "Next" to move forward
- Use "Prev" to review previous steps
- Use "Reset" to start over
- Use "Submit" to try new coordinates
Step 7: Experiment with Different Cases
- Try different polygon shapes:
- Completely inside window
- Partially intersecting window
- Completely outside window
- Modify clipping window size
- Observe how different configurations affect the result
Step 8: Understanding the Output
Watch the "Intermediate Vertices" panel:
- Shows current vertex coordinates
- Updates with each step
- Helps track vertex changes
Observe the canvas:
- Yellow elements show current state
- White elements show final result
- Coordinate labels help track positions
Tips for Best Results
- Start with default values to understand the process
- Use "Prev" to review any step in detail
- Pay attention to vertex coordinate changes
- Try different polygon configurations
- Observe how intersection points are created