Title: ??? Hidden Surface Removal
1??? Hidden Surface Removal
2Hidden-Line Removal Hidden-Surface Removal
?? 1. Back-Face Removal 2.
Depth-Buffer Z-Buffer 3.
Scan-Line Method 4. Depth Sorting 5.
Area Subdivision 6. Octree Method
3Hidden-Line Hidden-Surface Removal
Object Space ???????????? ?? ? ???? ?
????? ? ????????????
? ??????????
? ???? Image Space ????????(pixels)????
?? ? ???????? ? ?? ? ???????????
? ????????
? ????
4Back-Face Removal
????????? ???????,??????? Plane Equation
?Right-Handed Coordinate System ??
?
?Inside of plan
??????
5Y
N(A,B,C)
X
view Direction
?? Plane ??? Invisible, hidden
Z
view point
Identify all hidden surfaces ?? 1. ????
Completely Visible
Completely Hidden ?????????? 2.
Partially Hidden Need more test
??? ?????????
fast
6(No Transcript)
7Normal Vector of Plane
N(A,B,C)
Z
Normal Vector ? Component C ??? Viewing
Direction ? ??Clt0 Normal Vector points
away from viewing position ????
Back Face
C
8Plane Equation
3 points on the plane (not colinear)
9Two Planes
Plane 1 Plane 2
Plane 1
Plane 1
Plane 1
Plane 1
??
10Depth - Buffer Algorithm Z Buffer Algorithm
Image Space ? Test Visibility one pixel at a
time ? For each (x,y) pixel, the surface with the
smallest Z at that position is visible
11?
?
?
?
Viewing Direction
??Z ? ??Z ?
?Z???, ???Z?,????? ??
Intensity of S3 (Z3) Saved for position (x,y)
122 buffers Depth BufferStore Z-value for each
(x,y) position,
????(x,y)??? Refresh BufferStore Intensity Value
for each (x,y) position ????(x,y)???
Z?
??
13?? 0. Depth Normalized 01 Initially, all
positions Depth Buffer 1 (Maximum)
Refresh Buffer Background 1.
????Surface,????,?????(x,y)?? ?Z-value 2.
????(x,y)???Z-value 3. ????Z???,????Z??Intensity
14Depth Buffer Algorithm (Z - Buffer)
1. Initialize Depth Buffer and Refresh Buffer?
??? ???(x,y)?? Depth (x,y)1
Refresh (x,y)Background 2. ??Surface???(x,y)??Z??
?Z(x,y) z ??Z?? I (x,y) i ????
Intensity?
153. If Z (x,y)ltDepth (x,y) Z??? Then set
Depth (x,y) Z (x,y) Refresh
(x,y) I (x,y) If z lt ?? Depth (x,y)
??? Not Vision 4. ??????Surfaces???(x,y)?
??
16Depth-Buffer(Z-Buffer)??
?????????zi???(x,y)????? DepthBuffer RefreshBuff
er
??Z?,????????
z1??
(x,y)????? ?????
17Scan - Line Method
Image-Space ? one scan line at a time
????????? ? ???Scan line?intersection???edges??,
???????Surface???Visible 1. ??????????sorted
in order of increasing x? 2. ????Scan
line??????????Surface? 3. Scan line?Surface????fla
g?
18Line 1 ??AB, BC, HE, EF Line 1 AB ? BC
??S1 flag ON
Intensity for S1 ON
??S1 HE ? EF ??S2 flag ON
Line 2 ??DA, HE, BC, FG DA
?HE S1 ON HE ?BC BOTH ON
BC ?FG S1 OFF
S2 ON FG ?
S2 OFF
19? ????Surface ON ????Surface ? Both
Surface ON ??depth,???? ??depth of
S1lt S2 ???S1 ,????BC
S2
S1
OFF?Background
ON
1
ON
ON
OFF
OFF
OFF
ON
2
3
ON
ON
ON
OFF
OFF
20Depth Sorting Method
212. Resolve ambiguities??????? Reordering???
Z? ? Z?
3. Surfaces ?Depth Z??????,?Scan-Conversion
???
???? Sorting in Object Space
Scan-Conversion in Image Space also call
painters Algorithm
22- ???P,Q,R, Surface
- ??Z??z??
- ???Depth????? ? ???Scan-convert
- ???Depth???? ? Test
23(No Transcript)
241.
252.
P is outside Q
P is outside Q
263.
P is inside Q
P is inside Q
27????
Test 1
??Bounding Rectangles?X-extent,Y-extent????
Test 2
Q plane Equation EX FY GZ H 0
Vertices of P ?? Q plane e.q. Ex Fy Gz
H gt 0 P outside Q
(x,y,z)
28(No Transcript)
29Test 4
1.?????intersection?
2.Surfaces?X-Y??????projection??? intersection?
30???????,?????????
31(No Transcript)
32Area Subdivision Method
Image Space
- ?????????????????
- ???????????Visible or Hidden or No Surface
- Subdivision
- Single visible surface or No surface
- If NOT ? subdivision ? (1)
- Smallest division ? a pixel
33Area Subdivision Warnocks Algorithm
Surrounding Surface Surface????Area
Inside Surface Surface???Area?
Outside Surface Surface???Area?
Overlapping Surface Surface ???? ????
34??
- Surfaces??Area outside
? Background color
displayed in the area - ????Surface??inside or overlapping
? ??area?Background color,??Surface?area
???? - ????Surface??Surrounding
? area??Surrounding Surface??? - ??1?Surfaces?inside,overlapping,or
surrounding,???Surrounding???Z
? area????Z(??)?Surrounding Surface
35?????1???,?????Subdivision?
- ??Surfaces??outside the area?
- ?area???1?inside,overlapping,or
surrounding?surface? - ??Surrounding surface?Z???,????surface?
36(No Transcript)
37??Subdivision???area???1?pixel ?compare depth ???
Z-buffer
???area???,??? min Z?surface?subdivide a
area,??surface boundary?subdivision
38Quadtree ???
- area????
- ??????surface?area???
- Visible
- Hidden
- Inside
- Outside
- ????????
- ??????Quadtree division
39Octree ???
for viewing volume
project octree nodes onto viewing surfaces
0,1,2,3 ? front octants ? visible
4,5,6,7 ? back octants ? hidden
? removed