Professional Documents
Culture Documents
5 CAD & FEA Unit 1 Part 5
5 CAD & FEA Unit 1 Part 5
2 3 1’ and 2’ 2
3 4 3’
1
3’
4 5 4’ 6
4
5 6 5’ 5
5’
6 1 Noting 4’
With the components in the output list the same process is repeated
for the next window boundary.
Hidden Line/Surface Removal
Removing hidden lines and surfaces greatly improves the visualization of the
objects.
The appearance of the object is greatly complicated by the appearance of all
the details.
Object space
methods
HL/SR Vector
Image space
methods
Raster
Hidden Line/Surface Removal algorithm classification
Object space
methods
HL/SR Vector
Image space
methods
Raster
Raster based Hidden-surface algorithms
Back-face removal
Z-buffer (depth buffer)
Depth-sort algorithm
Back-face removal
The back face is identified based on the viewing direction and the direction
of the normal vector of a point in a plane.
V
N
Yv
Xv
To label any polygon as a back face consider the sign of C,
the component of the normal vector N
Zv
V = (0, 0, Vz)
if C < 0 and C= 0
Y
S3
Z
S2
(x,y)
S1
To override the closer polygon from the far ones two arrays are used.
X
Refresh Buffer: to store the intensity value of each position
Depth Buffer: to store depth value for (x,y) position
z values range from 0 at the back clipping plane to Zmax at the front clipping
plane
Procedure
It is an image space approach (Implemented in screen co-ordinate system)
1. Initialize the depth buffer and refresh buffer so that for all buffer positions (x,
y), depth (x,y)=0, refresh (x,y)= I background
2. For each position on each polygon surface, compare depth values to previously
stored values in the depth buffer to determine visibility.
Calculate the depth for each (x, y) position on the polygon.
If z > depth(x, y), then set depth (x,y)=z, refresh (x,y)= I surface (x,y)
After all surfaces have been processed, the depth buffer contains depth
values for the visible surfaces and the refresh buffer contains the corresponding
intensity values for those surfaces.
Advantage and Dis-advantage
Advantage
• The algorithm is simple
• The amount of storage required is also minimal.
Disadvantage
• For anti-aliasing effect the algorithm writes the pixels to the frame buffer
in an arbitrary order, and the necessary information for pre-filtering is not
easily available.
• For transparency and translucency effects, pixels may be written to the
frame buffer in incorrect order, leading to local errors.
Depth-Sort Algorithm
The depth-sort algorithms locates the polygons into the frame buffer in
the order of decreasing distance (depth) from the view point.,
Steps Involved
• Sort all the polygons according to the smallest z-coordinate of each.
• Resolve any ambiguities when the z-coordinates of polygons overlap, by
splitting the polygons.
• Scan and convert each polygon in ascending order from back to front (in
terms of z-coordinate).