You are on page 1of 13

VISIBLE SURFACE

DETECTION
The problem of Visibility – Occlusion.
Problem Definition:
Given a set of 3-D surfaces to be projected onto a 2-D screen, obtain
the nearest surface corresponding to any point on the screen.

Two types of methods were used:


Object-space methods (Continuous):
Compares parts of objects to each other to determine which surfaces
should be labeled as visible (use of bounding boxes, and check limits
along each direction).
Order the surfaces being drawn, such that it provides the correct
impression of depth variations and positions.
Image Space methods (discrete):
Visibility is decided point by point at each pixel position on the projection plane. Screen
resolution can be a limitation.
Hidden Surface – (a) Surface for rendering or (b) Line drawing
Coherence properties:
Object Coherence – If one object is entirely separate from another, do not compare.

Face Coherence – smooth variations across a face; incrementally modified.

Edge Coherence – Visibility changes if an edge crosses behind a visible face.

Implied edge coherence – Line of the intersection of a planar face penetrating another,
can be obtained from two points on the intersection.
Scanline coherence – Successive lines have similar spans.

Area Coherence – Span of an adjacent group of pixels is often covered by the same
visible face.
Depth Coherence – Use the difference equation to estimate the depths of nearby
points on the same surface.
Frame Coherence – Pictures of two successive frames of an animation sequence
are quite similar (small changes in object and viewpoint).
Different Visible Surface Detection Methods
 Back-face Detection
 Depth (Z) buffer method
 Scan-line method
 Depth-sorting method
 Area-subdivision method
 Octree methods
 A-buffer method
 BSP Trees
 Ray casting method
Back-Face detection
 When we project 3-D objects on a 2-D screen, we need to detect the faces that
are hidden on 2D we need Back-Face detection, also known as the Plane
Equation method.
 It is an object space method in which objects and parts of objects are
compared to find out the visible surfaces. Let us consider a triangular surface
whose visibility needs to decide.
 The idea is to check if the triangle will be facing away from the viewer or not.
If it does so, discard it for the current frame and move on to the next one.
 Each surface has a normal vector. If this normal vector is pointing in the
direction of the center of the projection, then it is a front face and can be seen
by the viewer.
 If this normal vector is pointing away from the center of the projection, then it
is a back face and can not be seen by the viewer.
Algorithm for the left-handed system :
1) Compute N for every face of the object.
2) If (C.(Z component) > 0)
then a back face and don't draw
else
front face and draw
The Back-face detection method is very simple. For the left-handed
system, if the Z component of the normal vector is positive, then it is
a back face. If the Z component of the vector is negative, then it is a
front face.
Algorithm for the right-handed system :
1) Compute N for every face of the object.
2) If (C.(Z component) < 0)
then a back face and don't draw
else
front face and draw

• Thus, for the right-handed system, if the Z component of the normal


vector is negative, then it is a back face. If the Z component of the
vector is positive, then it is a front face.
• Back-face detection can identify all the hidden surfaces in a scene
that contain non-overlapping convex polyhedral.
Recalling the polygon surface equation :
Ax + By + Cz + D < 0
While determining whether a surface is back-face or front face, also
consider the viewing direction. The normal of the surface is given by :
N = (A, B, C)
A polygon is the back face of the V view. N > 0. But it should be kept in
mind that after the application of the viewing transformation, the viewer
is looking down the negative Z-axis. Therefore, a polygon is back face if
(0, 0, -1).N > 0
or if C < 0
Viewer will also be unable to see the surface with C = 0, therefore,
identifying a polygon surface as a back face if C <= 0.
Considering (a),
V.N = |V||N|Cos(angle)
if 0 <= angle 0 and V.N > 0
Hence, Back-face.
Considering (b),
V.N = |V||N|Cos(angle)
if 90 < angle <= 180, then
cos(angle) < 0 and V.N < 0
Hence, Front-face
Limitations :
1) This method works fine for convex polyhedral, but not necessarily for concave
polyhedral.
2) This method can only be used on solid objects modelled as a polygon mesh.
Area Subdivision Algorithms
• The area-subdivision method takes advantage of area coherence in a scene by
locating those view
• areas that represent part of a single surface.
• The total viewing area is successively divided into smaller and smaller
rectangles until each small
• area is simple, ie. it is a single pixel, or is covered wholly by a part of a single
visible surface or no surface at all
The procedure to determine whether we should subdivide an area into smaller rectangles is:
1. We first classify each of the surfaces, according to their relations with the area:
Surrounding surface - a single surface completely encloses the area
Overlapping surface - a single surface that is partly inside and partly outside the area
Inside surface - a single surface that is completely inside the area
Outside surface - a single surface that is completely outside the area.
To improve the speed of classification, we can make use of the bounding rectangles of
surfaces for early confirmation or rejection that the surfaces should belong to that type.
2. Check the result from 1., that, if any of the following condition is true, then, no
subdivision of this area is needed.
a. All surfaces are outside the area.
b. Only one surface is inside, overlapping or surrounding surface is in the area.
c. A surrounding surface obscures all other surfaces within the area boundaries.
For cases b and c, the color of the area can be determined from that single surface

You might also like