Where do we Clip?
There are at least 3 different stages in the rendering
pipeline where we do various forms of clipping. In the trivial
rejection stage we remove objects that can not be seen. The
clipping stage removes objects and parts of objects that fall
outside of the viewing frustum. And, when rasterizing,
clipping is used to remove parts of objects outside of the
viewport.
/*
clip triangle's bounding box to raster
*/
xMin = (xMin < 0) ? 0 : xMin;
xMax = (xMax >= width) ? width - 1 : xMax;
yMin = (yMin < 0) ? 0 : yMin;
yMax = (yMax >= height) ? height - 1 : yMax;
|