#include <Clipper.h>
Inheritance diagram for Clipper:
List of all members.
Implements yer bog-standard line clipper. Rewritten a la Jim Blinn's presentation in IEEE CGA, Jan 91. Similar to Cohen-Sutherland, Cyrus-Beck, Liang-Barsky.
Note that this is supposed to come after the display transformations have been applied, but before the final divide by z. It's set up to assume by default that our final display space is the -1,-1 -> 1, 1 square in x, y, and that the near and far clipping planes have been mapped to z = 0 and 1 respectively.
The standard display pipeline is transform, clip, project, 2D draw. The Clipper class should be passed post-transform homogeneous coordinates. It will in turn call ViewPoint() with clipped coordinates. You should override ViewPoint() to perform the homogeneous divide, map to display coords, and do the drawing.
Definition at line 27 of file Clipper.h.
Definition at line 41 of file Clipper.cc.
[inline, pure virtual]
[protected]
[protected]
[protected]