CS488 More Visible-Surface Determination
Luc RENAMBOT
1
CS488 More Visible-Surface Determination Luc R ENAMBOT 1 - - PowerPoint PPT Presentation
CS488 More Visible-Surface Determination Luc R ENAMBOT 1 Examples The following sets of images show a wireframe version, a wireframe version with hidden line removal, and a solid polygonal representation of the same object 2 Examples
Luc RENAMBOT
1
The following sets of images show a wireframe version, a wireframe version with hidden line removal, and a solid polygonal representation of the same object
2
themselves before they are converted to pixels in the frame buffer.
calculation is done at the mathematical level of the objects
(involves comparing the polygons in object a to other polygons in a and to polygons in every other object in the scene)
4
being converted to pixels in the frame buffer
is done on a pixel by pixel basis
location
that location
5
polygons be drawn such that the vertices are given in counterclockwise order as you look at the visible side of polygon in order to generate the 'correct' normal.
points away from the viewer is a 'back-facing' polygon and does not need to be further investigated
6
Front facing Back facing
holds the color for each pixel to be displayed
bytes for each pixel depending on whether it was a grayscale, RGB, or color indexed frame buffer
set to be the background color
be the color of the line or polygon at that point
7
subdivision algorithm
are visible in the area, they are drawn
parts and the algorithm recurses.
single non-intersecting polygon
8
being drawn over top of objects that are further away
coordinate
9
coordinates of the polygons were guaranteed never to overlap
means that step 2 can be somewhat complex.
tested against each other
10
whose z extent overlaps P's x extent
before Q
then P is drawn and the next polygon from the back is chosen as the new P
11
the viewport ?
viewport ?
not overlap ?
12
and Q will work
Q but 3 and 4 do
from the viewport ?
the viewport ?
13
are swapped and the new P (formerly Q) is tested against all the polygons whose z extent overlaps it's z extent.
Q is split into 2 polygons using the plane of the
their proper places in the sorted list and the algorithm continues.
14
15
16
17
18
19
20
21
22
23
horizontal edges sorted based on the edges smaller y coordinate.
coordinate
24
to deal with being in or out of the polygon
Polygon Table
polygon
25
the active edge table when the scan line corresponding to the bottom of the edge is reached
when an edge of that polygon is crossed
must be determined
26
27
Two polygons ABC and DEF Scan Line AET contents Comments
alpha AB AC one polygon beta AB AC FD FE two separate polygons gamma AB DE CB FE two overlapping polygons gamma+1 AB DE CB FE two overlapping polygons gamma+2 AB CB DE FE two separate polygons
visible surfaces
be used to generate those o-so-pretty images
center of projection through that pixel and into the scene
that is first encountered
28
29
Given a Center Of Projection Given a window on the view plane for (each scan line) for (each pixel on the scan line) { Compute ray from COP through pixel for (each object in scene) if (object is intersected by ray && object is closer than previous intersection) record (intersection point, object) set pixel's color to the color of object at intersection point }
where does the ray intersect the object
Yo, Zo) at the COP , to (X1, Y1, Z1) at the center of the pixel
Yo + t(Y1 - Yo) Y = Yo + t(deltaY)
, t equal to 1 represents the pixel
30
31
and at most 20 hours for a single frame
intersection with a bounding box then leads to tests with several smaller bounding boxes within the larger bounding box
like buckets in a hash table, and objects within each partition are assigned to that partition. Checks can then be made against this constant number of partitions first before going on to checking the
contain equal numbers of polygons
32
33
# of polygonal faces in the scene Algorithm 100 250 60000
z-buffer 54 54 54 scan line 5 21 100 Warnock 11 64 307
15.3 in the textbook
34
250 polygons 550 polygons 6,000 polygons 8,000 polygons 10,000 polygons