Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solid Area Scan Conversion or Visible Surface Detection

Similar presentations


Presentation on theme: "Solid Area Scan Conversion or Visible Surface Detection"— Presentation transcript:

1 Solid Area Scan Conversion or Visible Surface Detection

2 P (viewing point) P (viewing point)

3 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 Find which surfaces are visible  visible-surface detection Remove those surfaces that should not be visible  hidden-surface removal.

4 Visible Surface Detection algorithm
Visible surface detection algorithms are broadly classified as: Object Space Methods: Compares objects and parts of objects to each other within the scene definition to determine which surfaces are visible Image Space Methods: Visibility is decided point-by-point at each pixel position on the projection plane Image space methods are by far the more common

5 Visible Surface Detection algorithm contd…
Two main types of algorithms: Object space: Determine which part of the object are visible Image space: Determine per pixel which point of an object is visible Object space Image space

6 Visible surface detection algorithms are based on following 2 concepts:
Sorting : It facilitate the depth comparison by ordering the object surface or lines in the scene according to their distance from the view plane Coherence : This method are used to take advantage of regularities in a scene ( It contain intervals of constant pixel intensity & scan pattern change (a little), from one line to other)

7 Visible Surface Detection Algorithms
Depth Comparison Z-buffer or Depth Buffer Depth Sorting or Painter’s Area Subdivision or Warnock’s Back Face detection A – Buffer Scan line BSP tree OCTree

8 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. When an object in 3D is projected on a view plane as projection pt(x,y)  it’s z-value is compared with the previously stored z-value. If it is smaller then new pixel is written to the frame buffer and z-buffer is updated with new z-value

9 S3 S2 y axis S1 Z3 Z2 Z1 x axis Order of scanning is S2s3s1 z axis

10 For (each position on each polygon surface)
Two buffers are needed: depth and color. Initialize the buffers: depth(x,y) = Zbackground color(x,y) = Ibackground For (each position on each polygon surface) calculate z for each (x,y)position if (z(x,y) < depth(x,y)) { depth(x,y) = Z color(x,y) = Isurf }

11 Painter’s algorithm (image space & object space)
This algorithm process the polygon as if they were being painted into the screen in order of their distance from the viewer. It has following basic steps  Surface are sorted in order of decreasing depth Surface are scan converted in order, starting with surface of greatest depth.

12 By Painter’s Algorithm

13 STEP 1 6 5 Store the polygon in array by uniquely numbering them 4 2 3 1 1 2 3 4 5 6 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

14 Initialization 1 2 3 4 5 6 6 5 4 2 3 1 Behind Counter Polygon Array
Front List 2 5 1 2 4 3 1 2 1 5 3 1 3 4 2 5 6

15 STEP 4 (loop) Repeat step 5 & step 6 till all polygon behind counter is -1 STEP 5 Draw all polygon’s whose behind counter is 0 STEP 6 After drawing Step through the polygon in the front list, decrease their behind counter by 1. For drawn polygon make it’s behind counter as -1

16 1 2 3 4 5 6 6 ITERATION -- 1 2 New Behind Counter Polygon Array
Front List Behind Counter 2 1 5 1 -1 2 4 3 1 1 2 1 5 3 3 1 4 2 2 5 -1 6

17 1 2 3 4 5 6 6 ITERATION -- 2 4 2 New Behind Counter Polygon Array
Front List Behind Counter 1 1 5 1 -1 -1 2 4 3 1 1 1 5 3 -1 3 4 2 2 5 -1 -1 6

18 1 2 3 4 5 6 6 ITERATION -- 3 4 2 3 New Behind Counter Polygon Array
Front List Behind Counter 1 5 1 -1 -1 2 4 3 1 -1 1 5 3 -1 3 -1 4 1 2 5 -1 -1 6

19 1 2 3 4 5 6 6 ITERATION -- 4 4 2 3 1 New Behind Counter Polygon Array
Front List Behind Counter -1 5 1 -1 -1 2 4 3 1 -1 -1 1 5 3 -1 3 -1 4 1 5 -1 -1 6

20 1 2 3 4 5 6 6 5 ITERATION -- 5 4 2 3 1 New Behind Counter
Polygon Array Front List Behind Counter -1 -1 5 1 -1 -1 2 4 3 1 -1 -1 1 5 3 -1 3 -1 4 -1 5 -1 -1 6

21 Depth-Sorting Algorithm 1
Summary Image and Object space Sort surfaces for depth Draw them back to front H&B 16-6:

22 For following type of polygons this will not work
Disadvantage For following type of polygons this will not work Solution Cyclically overlapping polygons require cutting Piercing polygons require clipping

23 Back-face Detection or Elimination
A point (x, y, z) is “inside” a surface with plane parameters A, B, C, and D if A point (x, y, z) is “outside” a surface with plane parameters A, B, C, and D if We cannot see the back-face of solid objects: Hence, these can be ignored

24 Back-face elimination
The polygon is a front face if Where, V is a vector in the viewing direction from the eye(camera) N is the normal vector to a polygon surface V N

25 Back-face elimination
The polygon is a back face if V N Where, V is a vector in the viewing direction from the eye(camera) N is the normal vector to a polygon surface

26 Back-face elimination
Object-space method Works fine for convex polyhedra: ±50% removed Concave or overlapping polyhedra: require additional processing Interior of objects can not be viewed Partially visible front faces


Download ppt "Solid Area Scan Conversion or Visible Surface Detection"

Similar presentations


Ads by Google