Chapter 13
Hidden
Entities Removal
- Object space algorithms: visibility of object with respect to other objects.
- Image space algorithm: Visibility of object at pixels. Resolution dependent.
13.1 Point Hidden by
Plane
13.2 Point Hidden by Polygon
Point-in-Polygon Test
Normal to a Polygon
•
Choose 3 consecutive noncolinear vertices v1, v2, v3
•
Normal: N =
(v1 , v2 ) × (v2 , v3 )
•
Front normal:
vertex listed in
clockwise order

Minmax Testing
Simple tests that may eliminate the need to more complex tests
•
Linear
extents
disjoint along
z (simplified
front/behind
test).
•
Bounding
box/rectangular
extent
disjoint along x
or along y .

13.3 Back-Face Culling
- Special case for preprocessing stage.
- Face: a polygon, given by its vertices v1, v2,...listed clockwise.
Outward normal
to a face: N =
(v1 , v2 ) × (v2 , v3 )

Invisible face:
positive value for
N . V = |N||V | cos
,
i.e., 90 <
< 270
- Invisible sides of
nonconvex polygons
are retained.
13.4 Apple’s Hidden-Line Algorithm
- Find QI of vertex of considered edge.
- Compute the intersection of the projection of the edge with all the other edges
- Move along the edge. Adjust QI at each intersection of the projection of the edge with the projection of another edge of a
polygon:
- Increase/decrease the count by 1 if we enter/leave the projection of the corresponding polygon (see ‘point-in-polygon test’).
- Remove segment with QI > 0.
13.5 Visible-Surface Ray Casting
Follow a ray
from the eye through
a pixel to determine
the object visible in
the pixel.
13.6 Z/Depth Buffer
- Screen coordinates for x and y
- An array, called z-buffer, recording current depth information for each pixel (of the frame buffer).
- A new contribution at (x, y) becomes dominant if its depth < depth recorded in the z-buffer.
- Efficient incremental methods apply to depth computations.
Coherence in Midpoint Line Algorithm
- First octane:
x = 1
- Partial slop:
z = (z2 - z1 )/(x2 - x1)
Coherence in Scanline Fill Algorithm
Resources
- Large memory, e.g., 1000 × 1000 = 106 cells.
- Working through the scanlines of the different polygons in parallel eliminates the need for the z-buffer.
13.7 List-Priority Algorithms
- Render polygons in decreasing order of their depth z.
- Resolusion of conflicts?
Painter’s Algorithm
- Fix z-depth to each polygon:
minimum/centroid/average
- 21
2D: each object resides in a plane of constant z (e.g., VLSI layout)
Depth Sort
Different tests performed in order of increasing complexity.
z-minimum
of polygon >
z-maximum of other
polygons
Polygon’s
projection is
x-disjoint or
y-disjoint from all
the other polygons
projections.
Polygon
behind the planes
containing the other
polygons.
Projected
polygon does not
intersect with the
projections of other
polygons.
•
Intersect
polygon plane
with the planes
of the other
polygons. Use
these boundaries
to partition the
polygon.
•
Above tests
might fail to
detect ordered
polygons.
13.8 Scan-Line Hidden Surface Elimination Algorithm
Polygon Table
- Coefficients of
plane equation
- Color
- In-out flag
Edge Representation
Edge Table (ET): sorted by (y,x)
- Plane equations help resolve conflicts in locations that the scan is in more than one polygon.
- A scan-line frame buffer and z buffer can simplify the algorithm
- Approach easily generalizes to other shapes besides polygons
13.9 Warnock’s Algorithm
•
Recursively divide the projection plane area into 4 until:
- Area intersects with at most one polygon.
- Not (1) + area is included within a polygon, and z-max of this polygon < z-min of all other polygons in this area.