Solid Area Scan Conversion or Visible Surface Detection
Solid Area Scan Conversion or Visible Surface Detection
or
Visible Surface Detection
P (viewing point)
P (viewing point)
visible-surface detection
Given a set of 3D object and viewing point
This process find which lines or parts of the object
are visible from the viewing point ,
So that it can draw only those part
A. Parallel projection
Let projection plane XY plane (orthographic proj)
z axis
2 pt.s p1(x1,y1,z1) & p2(x2,y2,z2) in p1
3D are on same projection line p2 p3
z axis
p1 p2 p3 p4 p5 pn p1
p3
Obscured by p2
Obscures p4
P1’ P2’
P4’
y axis
p4 p5 p6 pn x axis Zf
EM
B L
RO
P Given
Let 3 3D pt.s are given p1(1,2,0), p2(3,6,20), p3(2,4,6).
C.O.P is (0,0,-10)
Problem
Determine which pt obscures other
p1 p2 p3
Z-Buffer(Extension of frame buffer) (Image space)
• Frame buffer stores the intensity value of each
pixel in image space.
• Z-buffer(depth buffer) stores the z-coordinate
value of each pixel in image space.
S2
y axis
S1
Z3
Z2
Z1
x axis
STEP 2
For each polygon maintain a linked list named as front list
which will contain the polygon no. in front of it in a sequence
STEP 3
For each polygon maintain a counter named as behind
counter which will contain the no. of polygon behind to it
n 6 5
ti o
liza
i ti a 2 4
In 3
1
STEP 5
Draw all polygon’s whose behind counter is 0
STEP 6
After drawing
a) Step through the polygon in the front list, decrease
their behind counter by 1.
b) For drawn polygon make it’s behind counter as -1
ITERATION -- 1 6
New
Polygon Array Front List Behind Counter Behind Counter
2 1
1 5
0 -1
2 4 3 1
1 5 2 1
3
3 1 0
4
2 2
5
0 -1
6
ITERATION -- 2 6
2 4
New
Polygon Array Front List Behind Counter Behind Counter
5 1 1
1
2 4 3 1 -1 -1
1 5 1 0
3
3 0 -1
4
2 2
5
-1 -1
6
ITERATION -- 3 6
2 4
3
New
Polygon Array Front List Behind Counter Behind Counter
5 1 0
1
2 4 3 1 -1 -1
1 5 0 -1
3
3 -1 -1
4
2 1
5
-1 -1
6
ITERATION -- 4 6
2 4
3
1
New
Polygon Array Front List Behind Counter Behind Counter
5 0 -1
1
2 4 3 1 -1 -1
1 5 -1 -1
3
3 -1 -1
4
1 0
5
-1 -1
6
ITERATION -- 5 6 5
2 4
3
1
New
Polygon Array Front List Behind Counter Behind Counter
5 -1 -1
1
2 4 3 1 -1 -1
1 5 -1 -1
3
3 -1 -1
4
0 -1
5
-1 -1
6
Disadvantage
For following type of polygons this will not work
Solution
• Cyclically overlapping polygons require cutting
• Piercing polygons require clipping
Back-Face Detection
• A fast and simple object-space method for
locating back faces
• A point (x,y,z) is “inside” a polygon surface
with plane parameters A, B, C, D if :
Ax + By + Cz + D < 0
• When an inside point is along the line of sight
to the surface, the polygon must be a back
face and so cannot be seen
Back-Face Detection
• The test is simplified by considering the normal
vector N to the polygon and the viewing vector V
N A, B, C
Vview
03/12/02
BSP-Tree Example
A
C A
- +
4 3
B C
B - + - +
1
3 2 4 1
03/12/02
Building Example
• We will build a BSP tree, in 2D, for a 3 room building
5
– Ignoring doors
• Splitting edge order is shown
– “Back” side of edge is side with the number
2
3 4
6
Building Example (1)
5
1
- +
1
3a 4a
03/12/02
Building Example (2)
5b 5a
1
- +
2
3a, 4a, 6 - +
3b 2 4b
4b, 5a 3b, 5b
1
3a 4a
03/12/02
Building Example (3)
5b 5a
1
- +
2
3a
-
+ + 3b 2 4b
4a, 6 4b, 5a 3b
+
5b 1
3a 4a
03/12/02
Building Example (Done)
5b 5a
1
- +
2
3a
-
+ + 3b 2 4b
4a 4b 3b
+ + +
6 5a 5b 1
3a 4a
03/12/02
Traversing BSP-Tree
• Traverse the BSP tree such that the branch descended
first is the side that is away from the eyepoint. This can
be determined by substituting the eye point into the plane
equation for the polygon at the root.
04/24/2020
Traversing BSP-Tree Algorithm
Procedure DisplayBSP (tree: BSP_tree)
Begin
If tree is not empty then
If viewer is in front of the root then
Begin
DisplayBSP(tree.back_child)
displayPolygon(tree.root)
DisplayBSP(tree.front_child)
End
Else
Begin
DisplayBSP(tree.front_child)
displayPolygon(tree.root)
DisplayBSP(tree.back_child)
End
End
Traversing BSP Trees
EYE 1
A
F2
+Z B C
D
E1 F1 D
F1 C
E2 F2
E2
A
E1
B
+X -X
EYE 2
Splitting Triangles
If all our polygons are triangles then we
always divide a triangle into more
triangles when it is intersected by the
plane.
• If the view point changes, the BSP needs only minor re-rrangement.
1.3
1.2 1.4
Classification of polygons(p) w.r.t the given area(A)
1. Surrounding Polygon
P A
2. Intersecting Polygon A P
3. Contained Polygon AP
4. Disjoint Polygon A P
STEP 1
Initialize the area to be the whole scene
STEP 2
Create PVPL w.r.t the current area
STEP 3
Sort PVPL in terms of Zmin
STEP 4
Place the polygon in their appropriate category
STEP 5 (Perform the Visibility Test)
a. If all polygons are disjoint to the area, then set the
color of area as background color
P A P
P
P A
0 1
7 3 2
52
Displaying An Octree
• Map the octree onto a quadtree of visible
areas
– Traversing octree nodes from front to back in a
recursive procedure
– The quadtree representation for the 6
framebuffer
1
0
7 2
3
53
Octants in Space
Octrees
• Visible-surface identification is accomplished
by searching octree nodes in a front-to-back
order
Octree Methods
In these methods, octree nodes are projected onto
the viewing surface in a front-to-back order.
0 1 2 3 4 5 6 7
0 1
6
7
3 2
04/24/2020
Any of these octants could then be
recursively subdivide
Geometric forms & models
Modeling of object or picture means describing
them to the computer so as to produce visual
display that simulate the real thing
Simple Complex
• Points • Curved Segment
• Lines • Curved Surface
• Poly lines • Quadratic Surface
• Polygon
• Polyhedron
Advantage
A B
G
F
Disadvantage
none
Advantage
Used to represent more general wireframe model