Chapter 5
Chapter 5
3D Object
Representation
(CG)
3D Object Representation
Graphics scenes can contain many different kinds of objects like trees,
flowers, clouds, rocks, water etc. these cannot be describe with only
one methods but obviously require large precisions such as polygon &
quadratic surfaces, spline surfaces, procedural methods, volume
rendering, visualization techniques etc. Representation schemes for
(CG)
Asistant Professor Loknath Regmi
solid objects are often divided into two broad categories:
• Boundary representations (B-reps):
• describe a three-dimensional object as a set of surfaces that
separate the object interior from the environment.
• B-reps describe the objects exterior. It describes a 3d object as a
set of surfaces that encloses the objects interior. Examples:
Polygon surfaces and spline patches.
2
3D Object Representation
• Space-partitioning representations:
are used to describe interior properties, by partitioning
the spatial region containing an object into a set of small, non-
overlapping, contiguous solids (usually cubes). For example
Octree representation.
(CG)
Asistant Professor Loknath Regmi
3
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. Many graphics systems store all
object descriptions as sets of surface polygons. This simplifies
and speeds up the surface rendering and display of objects,
(CG)
Asistant Professor Loknath Regmi
since all surfaces are described with linear equations. For this
reason, polygon descriptions are often referred to as “standard
graphics objects”.
Generally polygon surfaces are specified using;
1. Polygon Table
2. Plane Equations
3. Polygon Meshes.
4
1. Polygon Tables
Polygons tables can be used specified specify polygon surfaces.
We specify a polygon surface with a set of vertex coordinates and
associated attribute parameters. As information for each polygon is
input, the data are placed into tables that are to be used in the
subsequent' processing, display, and manipulation of the objects in a
scene.
(CG)
Asistant Professor Loknath Regmi
Polygon tables can be organized into two groups:
1. Geometric tables
2. Attribute tables
(CG)
Asistant Professor Loknath Regmi
the object.
• Edge Table: The edge table contains pointers back into the
vertex table to identify the vertices for each polygon edge.
(CG)
Asistant Professor Loknath Regmi
7
1. Polygon Tables..
a) Geometric tables
S2
S1
S4
S2
(CG)
Asistant Professor Loknath Regmi
8
1. Polygon Tables..
b) Attribute tables
Attribute information for an object includes parameters
specifying the degree of transparency of the object and its
surface reflectivity and texture characteristics. The above three
table also include the polygon attribute according to their
(CG)
Asistant Professor Loknath Regmi
pointer information.
9
2. Polygon Meshes
A polygon mesh is a collection of vertices, edges and
faces that defines the shape of a polyhedral object in 3D
computer graphics
1. Triangular Mesh :
(CG)
Asistant Professor Loknath Regmi
It produces minimum n – 2 connected triangles, given the
coordinates for n vertices.
10
2. Polygon Meshes ...
2 . Quadrilateral Mesh
Another similar functions the quadrilateral mesh that
generates a mesh of (n-1)(m-1) quadrilaterals, given the
coordinates for an n by m array of vertices
(CG)
Asistant Professor Loknath Regmi
6 by 8 vertices array , 35
element quadrilateral
mesh
11
(CG)
Asistant Professor Loknath Regmi
V1
P1 P3
P2
V2 V3
P1= { V1,V2,V5}
P2={ V2,V3,V5}
P3={V3,V4,V5}
12
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
2. Polygon Meshes ...
(CG)
3. Plane Equation
It is used to determine the spatial orientation of the
individual surface component of the object. The equation for a
plane surface can be expressed in the form
Ax+By+Cz+D=0
(CG)
Asistant Professor Loknath Regmi
where (x, y, z) is any point on the plane, and the coefficients A ,
B , C , and D are constants. Let (x1 y1, z1,), (x2, y2, z2), and (x3, y3, z3) be
three successive polygon vertices of the polygon.
Ax1 + By1+Cz1 + D= 0,
Ax2 + By2+Cz2 + D= 0,
Ax3 + By3+Cz3 + D= 0
20
3. Plane Equation ..
• Using Cramer's Rule
Ax1 + By1+Cz1 + D= 0,
Ax2 + By2+Cz2 + D= 0,
Ax3 + By3+Cz3 + D= 0
(CG)
Asistant Professor Loknath Regmi
-
21
3. Plane Equation ..
• Inside outside tests of the surface:
A x + B y + C z + D < 0, point (X,Y,Z) is inside the surface
A x + B y + C z + D > 0, point (X,Y,Z) is outside the surface
(CG)
Asistant Professor Loknath Regmi
22
Wireframe
(CG)
Wireframe
• A wireframe is a three-dimensional model that only includes
vertices and lines. It does not contain surfaces, textures, or
lighting like a 3D mesh.
• Instead, a wireframe model is a 3D image comprised of only
"wires" that represent three-dimensional shapes.
(CG)
Asistant Professor Loknath Regmi
• A wire-frame model is a visual presentation of a 3-
dimensional (3D) or physical object used in 3D computer
graphics.
24
Wireframe
• Wireframes provide the most basic representation of a three-
dimensional scene or object.
• They are often used as the starting point in 3D modeling since
they create a "frame" for 3D structures. For example, a 3D
graphic designer can create a model from scratch by simply
(CG)
Asistant Professor Loknath Regmi
defining points (vertices) and connecting them with lines
(paths).
• Once the shape is created, surfaces or textures can be added
to make the model appear more realistic.
25
Wireframe
• The lines within a wireframe connect to create polygons, such
as triangles and rectangles, that together represent three-
dimensional shapes.
• The result may be as simple as a cube or as complex as a
three-dimensional scene with people and objects. The
(CG)
Asistant Professor Loknath Regmi
number of polygons within a wireframe is typically a good
indicator of how detailed the 3D model is.
26
Wireframe
(CG)
Blobby Objects
(CG)
Blobby Objects
• By a blobby object we mean a nonrigid object. That is things,
like cloth, rubber, liquids, water droplets, etc.
• These objects tend to exhibit a degree of fluidity.
• For example, in a chemical compound electron density clouds
(CG)
Asistant Professor Loknath Regmi
tend to be distorted by the presence of other
atoms/molecules
29
More Blobby Objects
• Several models have been developed to handle
these kind of objects.
• One technique is to use a combination of Gaussian
density functions (Gaussian bumps).
(CG)
Asistant Professor Loknath Regmi
• A surface function could then be defined by:
f(x,y,z) = k bk*exp(-ak*r 2) - T =0
k
where r 2 = x k2 + y k2 + z 2k k 30
Spline Representation
• A spline curve is a mathematical representation for which it is
easy to build an interface that will allow a user to design and
control the shape of complex curves and shapes
• The general approach is that the user enters a sequence of
points and a curve is constructed whose shape closely follows
(CG)
Asistant Professor Loknath Regmi
this sequence . The point are called control point.
Control Point
31
Control Point
Control Point
Spline Representation
• A curve is actually passes through each control point is called
interpolating curve
• A curve that passes near to the control point but not
necessarily through them is called an approximating curve.
(CG)
Asistant Professor Loknath Regmi
Interpolating Curves 32
Approximation Curves
Spline Representation
n=4
n=3
n=2
(CG)
Asistant Professor Loknath Regmi
First Order (Linear) Second Order (Quadratic) Third Order (Cubic)
Fig : Interpolating
33
Parametric Cubic Curve
• A parametric cubic curve is defined as
(CG)
Asistant Professor Loknath Regmi
34
Where, P(t) is a point on the curve
a= algebraic coefficients
t= tangent Vector
Parametric Cubic Curve
Expanding equation (i) yield
P (t) = a3 t3 + a2 t2 + a1 t + a0 ------------------------------ (ii)
(CG)
Asistant Professor Loknath Regmi
z (t) = a3z t3 + a2z t2 + a1z t + a0z ---------------------(iii)
(CG)
Parametric Cubic Curve
• This procedure for defining a cubic curve using end points and
tangent vector is one form of Hermite interpolation
• Each cubic curve segment is parameterized from 0 to 1 so that
known end points correspond to the limit values of the
(CG)
Asistant Professor Loknath Regmi
parametric variable t, that is P(0) and P(1)
• Substituting t = 0 and t = 1 the relationship between two end
point vectors and the algebraic coefficients are found
P (t) = a3 t3 + a2 t2 + a1 t + a0
P (t) = a3 t3 + a2 t2 + a1 t + a0
(CG)
Asistant Professor Loknath Regmi
P’ (t) = 3 a3 t 2 + 2 a2 t + a1
38
Parametric Cubic Curve
• The algebraic coefficients ‘ai‘ in equation (ii) can now be
written explicitly in terms of boundary conditions – endpoints
and tangent vectors are
a0= P (0) a1= P’ (0)
a2= -3 P (0) - 3 P (1) -2 P’ (0) - P’ (1)
(CG)
Asistant Professor Loknath Regmi
a3 = 2 P (0) - 2 P (1) + P’ (0) + P’ (1)
(Note: - The value of a2 & a3 can be determined by solving the equation IV & V)
• Substituting these values of ‘ai’ in equation (ii) and rearranging
the terms yields
P(t) = (2t3 - 3t2 + 1) P(0) + (-2t3 + 3t2) P(1) + (t3 - 2t2 + t) P’(0)+ (t3 - t2 ) P’(1)
• The values of P(0), P(1), P’(0), P’(1) are called geometric coefficients and
represent the known vector quantities in the above equation
• The polynomial coefficients of these vector quantities are commonly known
as blending functions By varying parameter t in these blending function 39
from 0 to 1 several points on curve segments can be found
Bezier Curve and Surfaces
Bezier splines are highly useful, easy to implement and
convenient for curve and surface design so are widely available
in various CAD systems, graphics packages, drawing and painting
packages.
Bezier curve
(CG)
Asistant Professor Loknath Regmi
In general, a Bezier curve can be fitted to any number of
control points. The number of control points to be
approximated and their relative position determine the degree
of the Bezier polynomial. As with the interpolation splines, a
Bezier curve can be specified with boundary conditions, with a
characterizing matrix, or with blending functions.
40
Bezier Curve
The Bezier curve has two important properties:
1. It always passes through the first and last control points.
2. It lies within the convex hull (convex polynomial
boundary) of the control points. This follows from the
(CG)
Asistant Professor Loknath Regmi
properties of Bezier blending function: they are positive
and their sum is always 1, i.e.
41
Bezier Curve
Suppose we are given n + 1 control-point positions:
pk = (xk, yk, zk), with k varying from 0 to n. These coordinate
points can be blended to produce the following position vector
P(u), which describes the path of an approximating Bezier
polynomial function between p0 and pn.
(CG)
Asistant Professor Loknath Regmi
42
Bezier Curve
This, vector equation represents a set of three parametric
equations for the individual curve coordinates:
(CG)
Asistant Professor Loknath Regmi
The Bezier blending functions BEZ k, n (u)
are the Bernstein polynomials:
43
Bezier Curve
Now
(n = 3)
(CG)
Asistant Professor Loknath Regmi
Then ,
P(u) = P0 BEZ0,3 (u) + P1 BEZ1,3 (u) + P2 BEZ2,3 (u) + P3 BEZ3,3 (u)
Four blending functions must be found based on Bernstein
Polynomials
44
Bezier Curve
Normalizing properties apply to blending function s that means
thy all add up to one Substituting these functions in above
equation
P(u) = (1-u)3 P0 + 3u (1-u)2 P1 + 3u2 (1-u) P2 + u3 P3
(CG)
Asistant Professor Loknath Regmi
When u = 0 then P(u) = P0 and
when u =1 then P(u) = P3
P(u)
45
Properties Of Bezier Curve
1. Bezier curve lies in the convex hull of the control points which
ensure that the curve smoothly follows the control Points
(CG)
Asistant Professor Loknath Regmi
2. Four Bezier polynomials are used in the construction of curve
to fit four control points
3. It always passes thru the end points
4. Closed curves can be generated by specifying the first and last
control points at the same position
46
Properties Of Bezier Curve
5. Specifying multiple control points at a single position
gives more weight to that position
6. Complicated curves are formed by piecing several
sections of lower degrees together
(CG)
Asistant Professor Loknath Regmi
7. The tangent to the curve at an end point is along the line
joining the end point to the adjacent control point
47
Example
Q.N. > Calculate (x,y) coordinates of Bézier curve described by
the following 4 control points: (0,0), (1,2), (3,3), (4,0).
Step by step solution
For four control points, n = 3.
(CG)
Asistant Professor Loknath Regmi
First calculate all the blending functions, Bkn for k=0,..,n using
the formula:
48
Numerical calculations are shown below:
(CG)
Asistant Professor Loknath Regmi
49
Asistant Professor Loknath Regmi
50
(CG)
Asistant Professor Loknath Regmi
51
(CG)
The plot below shows control points (joined with a thin line)
and a Bézier curve with 6 steps
(CG)
Asistant Professor Loknath Regmi
52
The plot below shows control points (joined with a thin line)
and a Bézier curve with 11 steps; note smoother appearance of
this curve in comparison to the previous one.
(CG)
Asistant Professor Loknath Regmi
53
Q.N.>Construct the Bezier curve of order 3 and 4
polygon vertices A(1,1) B(2,3) C(4,3) and D(6,4). (TU
2072)
(CG)
Asistant Professor Loknath Regmi
54
Quadric surfaces
• If a surface is the graph in three-space of
an equation of second degree, it is called a
quadric surface. Cross section of quadric
(CG)
Asistant Professor Loknath Regmi
surface are conics.
• Quadric Surface is one of the frequently
used 3D objects surface representation.
The quadric surface can be represented by
a second degree polynomial. This includes:
55
Quadric surfaces
(CG)
Quadric surfaces
(CG)
Finished
Chapter 5
(CG)