Clipping other primitives
- In hardware, we almost always clip line segments or points.
- At some level, text, curves, ... are always represented by either pixels or lines.
- Raster vs vector fonts.
- EVERYTHING needs to be discretized
- But we may wish to clip BEFORE we send it to the hardware.
- Or at least partially clipped.
- A bounding box
- is a rectangle (2D or 3D) which encloses the shape.
- We want it to be as "Tight" as possible.
- Sometimes we use a bounding sphere or circle.
- But we want a bounding shape that is very easy to test for:
- Clipping or exclusion (Our current topic)
- Ray intersection (Most lighting models, ray tracing ...)
- Collision detection.
- For clipping, an axis aligned bounding box is really good.
- The idea is to perform test on the bounding object.
- If it is accepted or rejected no further interaction with the object is required.
- If it is to be clipped, then we can further examine the object, (If we need to)
- he mentions that many APIs automatically append bounding boxes to objects.
- If we need to clip the curves themselves
- We would like to turn it into line segments.
- If we can't we do much more work determine what will be drawn.
- This will (probably) be computationally expensive.
- For shapes like circles, we can try to employ symmetry.
- This is probably a case by case bases for non-polygon/line/point objects we wish to clip.
- Text
- ALL-OR-Nothing on characters/strings
- Vector characters - see previous
- The nature of characters. (As before I hope)
- 3D clipping
- The three algorithms we have discussed can be extended to 3d
- Cohen-Sutherland - 6 bit outcode
- Liang-Barsky -z(α) = (1-α)z1 + αz2
- Sutherland-Hodgeman just add two more clippers to the pipeline
- In all cases, we are clipping against a plane, not a line.
- But we can rewrite the plane equations as we did the line equations.