Download "user manual"

Transcript
Clipping
8.0 54
n
P
Q
Clipping a point to a halfspace:
• Represent window edge as implicit line/halfspace.
• Use the implicit form of edge to classify a point Q.
• Must choose a convention for the normal:
points to the inside.
• Check the sign of `(Q):
– If `(Q) > 0, then Q is inside.
– Otherwise clip (discard) Q:
It is on the edge or outside.
May want to keep things on the boundary.
Clipping a line segment to a halfspace:
There are three cases:
1. The line segment is entirely inside:
Keep it.
2. The line segment is entirely outside:
Discard it.
3. The line segment is partially inside and partially outside:
Generate new line to represent part inside.
n
P
Input Specification: