Three-Dimensional Clipping
Problem statement
Like most everything else we've seen this semester, clipping
in three dimensions is more complicated than clipping in two
dimensions.
But before we dive in lets take a step back and ask a few
questions.
What is clipping?
- Clipping is a procedure for partitioning geometric primitives.
Clipping can be used to:
- Distingish whether geometric primitivies are inside or outside
of a viewing frustum
- Distinguish whether geometric primitivies are inside or outside
of a picking frustum
- Detecting intersections between primitives
- Clipping is a procedure for subdividing geometric primitives.
This view of clipping admits several other potential applications.
- Binning geometric primitives into spatial data structures.
- Computing analytical shadows.
- Computing intersections between primitives
Why do we clip?
Clipping is an important optimization.
- Clipping is a visibility preprocess. In real-world
scenes clipping can remove a substantial percentage of
the environment from consideration.
- Assures that only potentially visible primitives
are rasterized. What advantage does this have over
two-dimensional clipping. Are there cases where you
have to clip?
Cohen-Sutherland Outcode Clipping
Cohen-Sutherland outcode clipping is used primarily in partioning applications
or for trivial rejection for visiblity computation. The idea is very simple and
it can be explained in two dimensions.
For each primitive that we test we will assign a single bit to each
clipping boundary. In this two-dimensional example, we are clipping against
four boundaries, thus we will need four bits.
We then consider each of the vertices defining the primitive under
consideration. If all of these vertices are have an out code of all
zeros the primitive is trivially accepted. It is trivially rejected
if the bit-by-bit logical and of the codes for each vertex is
not all zeros.
Let's consider some simple examples:
For lines only the two end points are considered. In trangles, or any
convex polygon we consider each vertex.
Sutherland-Hodgman Plane-at-a-time Clipping
Other Clipping algorithms
This page was last modified on Monday, November 04, 1996