CG Unit 3
CG Unit 3
SYLLABUS
Polygon Surfaces
The most commonly used boundary representation for a three-dimensional
graphics object is a set of surface polygons that enclose the object interior. The
wireframe outline can be displayed quickly to give a general indication of the
surface structure. Realistic renderings are produced by interpolating shading
patterns across the polygon surfaces to eliminate or reduce the presence of
polygon edge boundaries.
In this method, the surface is specified by the set of vertex coordinates and
associated attributes. As shown in the following figure, there are five vertices,
from v1 to v5.
Each vertex stores x, y, and z coordinate information which is represented in
the table as v1: x1, y1, z1.
The Edge table is used to store the edge information of polygon. In the
following figure, edge E1 lies between vertex v1 and v2 which is represented in
the table as E1: v1, v2.
Polygon Meshes
3D surfaces and solids can be approximated by a set of polygonal and line
elements. Such surfaces are called polygonal meshes. In polygon mesh, each edge
is shared by at most two polygons. The set of polygons or faces, together form the
“skin” of the object. This method can be used to represent a broad class of
solids/surfaces in graphics. A polygonal mesh can be rendered using hidden
surface removal algorithms.
5|Page Ashish Tripathi
The polygon mesh can be represented by three ways:
Explicit representation
Pointers to a vertex list
Pointers to an edge list
Quadric Surfaces
A frequently used class of objects are the quadric surfaces, which are described
with second-degree equations (quadratics). They include spheres, ellipsoids, tori,
paraboloids, and hyperboloids.
11 | P a g e Ashish Tripathi
Specular Reflection:
A highlight, or bright spot, at certain viewing directions in polished metal
surfaces is due to a phenomenon, called specular reflection, and is the result of
total, or near total, reflection of the incident light in a concentrated region
around the specular reflection angle.
Shiny surfaces have a narrow specular-reflection range, and dull surfaces have a
wider reflection range. An empirical model for calculating the specular-reflection
range, developed by Phong Bui Tuong and called the Phong specular-reflection
model, or simply the Phong model, sets the intensity of specular reflection
proportional to cosns ф. Angle ф can be assigned values in the range 0 to 90, so
that cos ф varies from 0 to 1. The value assigned to specular-reflection parameter
ns, is determined by the type of surface that we want to display. A very shiny
surface is modeled with a large value for ns, (say, 100 or more), and smaller
values (down to 1) are used for duller surfaces. For a perfect reflector, ns, is
infinite. For a rough surface, such as chalk or cinderblock, n, would be assigned a
value near 1. We can approximately model monochromatic specular intensity
variations Ispec using a specular-reflection coefficient, W (θ), for each surface.
We can reasonably model the reflected light effects by replacing W(θ) with a
constant specular-reflection coefficient ks. We then simply set ks equal to some
value in the range 0 to 1 for each surface. Since V (viewer) and R are unit vectors
in the viewing and specular-reflection directions, we can calculate the value of
cos ф with the dot product V.R. Assuming the specular-reflection coefficient is a
constant, we can determine the intensity of the specular reflection at a surface
point with the calculation
12 | P a g e Ashish Tripathi
-
13 | P a g e Ashish Tripathi
Polygon Rendering Methods:
Constant-Intensity Shading
A fast and simple method for rendering an object with polygon surfaces is
constant-intensity shading, also called flat shading. In this method, a single
intensity is calculated for each polygon. All points over the surface of the polygon
are then displayed with the same intensity value.
Constant shading can be useful for quickly displaying the general appearance of a
curved surface. In general, flat shading of polygon facets provides an accurate
rendering for an object if all of the following assumptions are valid:
The object is a polyhedron and is not an approximation of an object with a
curved surface.
All light sources illuminating the object are sufficiently far from the surface
so that N.L and the attenuation function are constant over the surface.
The viewing position is sufficiently far from the surface so that V.R is
constant over the surface.
Even if all of these conditions are not true, we can still reasonably approximate
surface-lighting effects using small polygon facets with flat shading and calculate
the intensity for each facet, say, at the center of the polygon.
Phong Shading
A more accurate method for rendering a polygon surface is to interpolate normal
vectors, and then apply the illumination model to each surface point. This
method, developed by Phong Bui Tuong, is called Phong shading, or normal
vector interpolation shading. It displays more realistic highlights on a surface
and greatly reduces the Mach-band effect. A polygon surface is rendered using
Phong shading by carrying out the following steps:
1. Determine the average unit normal vector at each polygon vertex.
2. Linearly interpolate the vertex normals over the surface of the polygon.
3. Apply an illumination model along each scan line to calculate projected
pixel intensities for the surface points.
The normal vector N for the scan-line intersection point along the edge between
vertices 1 and 2 can be obtained by vertically interpolating between edge
endpoint normals:
14 | P a g e Ashish Tripathi
END OF UNIT III
15 | P a g e Ashish Tripathi