File Area Primitives: Surface Tessellation
File Area Primitives: Surface Tessellation
3
Polygon Fill Area
Splitting concave polygons
- Split concave polygons
into a set of convex
polygons
- Using edge vectors and
edge cross products
- Use vertex position
relative to edge
extension line.
4
Polygon Fill Area
Splitting concave polygons
• Assume all polygons in xy plane
• Ek = Vk+1 – Vk
• Calculate cross product of successive edge
vectors
- if at least z component of one vector is
negative, then concave polygon.
- no successive vertices are collinear.
• Split along the line of the first edge vector in
the cross product pair. 5
Polygon Fill Area
Splitting concave polygons
6
Polygon Fill Area
Splitting concave polygons
7
Polygon Fill Area
Splitting concave polygons
• Another method is a rotational method
8
Polygon Fill Area
Splitting convex polygons into triangle
(tessellation)
- define any sequence of three consecutive
vertices to a triangle.
- delete middle vertex from the original list
- continue forming triangle
- stop when only three vertices are
remaining.
9
Polygon Fill Area
Inside-Outside test
• Also called odd-even test/rule or even-odd
rule/ odd-parity rule.
10
Polygon Fill Area
Winding-Number test
• Count counterclockwise encirclements of
point(no of times the boundary of object
“winds” around a particular point)
11
Polygon Fill Area
Polygon tables
• objects in a scene are described as sets of polygon
surface facets
• Object description includes:
- Coordinate information (geometry for the polygon facets)
- Surface parameters(color, transparency, and light-
reflection properties)
• Object information are organized in tables:
geometric and attribute
12
Polygon Fill Area
Polygon tables
13
Polygon Fill Area
Polygon tables
• Important to check for consistency and
completeness:
1. each vertex is an end point for at least two edges.
2. every edge is part of at least one polygon
3. every polygon is closed
4. each polygon has at least one shared edge
14
Plane Equations
• To produce a display of a three-dimensional
scene, a graphics system processes the input
data through several procedures.
• These procedures include transformation of
the modeling and world-coordinate
descriptions through the viewing pipeline,
identification of visible surfaces, and the
application of rendering routines to the
individual surface facets.
• Each polygon in a scene is contained within a plane
of infinite extent. The general equation of a plane is
Ax + B y + C z + D = 0, where (x, y, z) is any point on
the plane, and the coefficients A, B, C, and D(called
plane parameters) are constants describing the
spatial properties of the plane.
• We can obtain the values of A, B, C, and D by solving
a set of three plane equations using the coordinate
values for three noncollinear points in the plane
• For this purpose, we can select three
successive convex-polygon vertices,
(x1, y1, z1), (x2, y2, z2), and (x3, y3, z3), in a
counterclockwise order and solve the following
set of simultaneous linear plane equations for
the ratios A/D, B/D, and C/D:
• (A/D)xk + (B/D)yk + (C/D)zk = −1, k = 1, 2, 3
• The solution to this set of equations can be
obtained in determinant form, using Cramer’s
rule, as
• Expanding the determinants, we can write the
calculations for the plane coefficients in the
form
• A = y1(z2 − z3) + y2(z3 − z1) + y3(z1 − z2)
• B = z1(x2 − x3) + z2(x3 − x1) + z3(x1 − x2)
• C = x1(y2 − y3) + x2(y3 − y1) + x3(y1 − y2)
• D = −x1(y2z3 − y3z2) − x2(y3z1 − y1z3) −
x3(y1z2 − y2z1)
Front and back polygon faces
• For any point (x, y, z) not on a plane with parameters A, B,
C, D, we have
Ax + B y + C z + D != 0
• Thus, we can identify the point as either behind or in front
of a polygon surface contained within that plane according
to the sign (negative or positive) of Ax + By + Cz + D:
• if Ax + B y + C z + D < 0, the point (x, y, z) is behind the
plane
• if Ax + B y + C z + D > 0, the point (x, y, z) is in front of the
plane
• Orientation of a polygon surface in space can
be described with the normal vector for the
plane containing that polygon, as shown in
Figure
FILL AREA ATTRIBUTES
• Graphic systems requires fill areas to be convex
polygons, so that scan lines do not intersect
more than two boundary edges.
• Fill Styles
• A basic fill-area attribute provided by a general
graphics library is the display style of the interior.
We can display a region with a single color, a
specified fill pattern, or in a “hollow” style by
showing only the boundary of the region.
• These three fill styles are illustrated in Figure