UNIT - 5 3D Object Representation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

https://genuinenotes.

com

3D Object

Nipun Thapa (computer Graphics)


Representation
Unit 5

1
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


3
https://genuinenotes.com

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,

Nipun Thapa (computer Graphics)


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
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


Polygon tables can be organized into two groups:
1. Geometric tables
2. Attribute tables

1. Geometric data tables: Contain vertex coordinates and


parameters to identify the spatial orientation of the polygon
surfaces.
2. Attribute tables: Provide information for an object and includes
parameters specifying the degree of transparency of the object
and its surface reflectivity and texture characteristics. 5
https://genuinenotes.com

1. Polygon Tables..
Geometric data consists of three tables: a vertex table,
an edge table, and a surface table.

• Vertex table: It stores co-ordinate values for each vertex of

Nipun Thapa (computer Graphics)


the object.

• Edge Table: The edge table contains pointers back into the
vertex table to identify the vertices for each polygon edge.

• Surface table: And the polygon table contains pointers back


into the edge table to identify the edges for each polygon
surfaces. 6
https://genuinenotes.com

1. Polygon Tables..
a) Geometric tables

Nipun Thapa (computer Graphics)


7
https://genuinenotes.com

1. Polygon Tables..
a) Geometric tables

S2
S1
S4
S2

Nipun Thapa (computer Graphics)


8
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


pointer information.

9
https://genuinenotes.com

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 :

Nipun Thapa (computer Graphics)


It produces n – 2 connected triangles, given the coordinates for
n vertices.

10
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


6 by 8 vertices array , 35
element quadrilateral
mesh

11

If the surface of 3D object is planner. It is confortable to represent surface with


meshes
https://genuinenotes.com

2. Polygon Meshes ...


• Representation Polygon meshes
P = { (X1,Y1,Z1), (X2,Y2,Z2),………,(Xn,Yn,Zn)}
Each polygon represent by a list of vertex of coordinate
V5 V4

Nipun Thapa (computer Graphics)


V1
P1 P3

P2
V2 V3

P1= { V1,V2,V3}
P2={ V2,V3,V5}
P3={V3,V4,V5}
12
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


13
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


14
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


15
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


16
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


17
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


18
https://genuinenotes.com

2. Polygon Meshes ...

Nipun Thapa (computer Graphics)


19
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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
https://genuinenotes.com

3. Plane Equation ..
• Using Cramer's Rule
Ax1 + By1+Cz1 + D= 0,
Ax2 + By2+Cz2 + D= 0,
Ax3 + By3+Cz3 + D= 0

Nipun Thapa (computer Graphics)


-

Expanding the determinant we can write that,

21
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


22
https://genuinenotes.com

Nipun Thapa (computer Graphics)


Wireframe
23
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


• A wire-frame model is a visual presentation of a 3-
dimensional (3D) or physical object used in 3D computer
graphics.

24
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


number of polygons within a wireframe is typically a good
indicator of how detailed the 3D model is.

26
https://genuinenotes.com

Wireframe

Nipun Thapa (computer Graphics)


27
https://genuinenotes.com

Nipun Thapa (computer Graphics)


Blobby Objects
28
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


tend to be distorted by the presence of other
atoms/molecules

29
https://genuinenotes.com

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).

Nipun Thapa (computer Graphics)


• 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
https://genuinenotes.com

Still More Blobby Objects


• Another technique called the meta-ball technique is to
describe the object as being made of density functions
much like balls.
• The advantage here is that the density function

Nipun Thapa (computer Graphics)


falls of in a finite interval.

31
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


this sequence . The point are called control point.
Control Point

32
Control Point
Control Point
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


Interpolating Curves 33
Approximation Curves
https://genuinenotes.com

Spline Representation
n=4
n=3

n=2

Nipun Thapa (computer Graphics)


First Order (Linear) Second Order (Quadratic) Third Order (Cubic)

Fig : Interpolating

34
https://genuinenotes.com

Parametric Cubic Curve


• A parametric cubic curve is defined as

Nipun Thapa (computer Graphics)


P(t)

35
Where, P(t) is a point on the curve
a= algebraic coefficients
t= tangent Vector
https://genuinenotes.com

Parametric Cubic Curve


Expanding equation (i) yield
P (t) = a3 t3 + a2 t2 + a1 t + a0 ------------------------------ (ii)

This equation is separated into three components of P (t)


x (t) = a3x t3 + a2x t2 + a1x t + a0x
y (t) = a3y t3 + a2y t2 + a1y t + a0y

Nipun Thapa (computer Graphics)


z (t) = a3z t3 + a2z t2 + a1z t + a0z ---------------------(iii)

• To be able to solve (iii) the twelve unknown coefficients aij (algebraic


coefficients) must be specified
• From the known end point coordinates of each segment, six of the twelve
needed equations are obtained.
• The other six are found by using tangent vectors at the two ends of each
segment
• The direction of the tangent vectors establishes the slopes(direction cosines) of
the curve at the end point 36
https://genuinenotes.com

Parametric Cubic Curve

Nipun Thapa (computer Graphics)


37
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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 (0) = a0 P (1) = a3 + a2 + a1 + a0 ----- ---- ---- (IV) 38


https://genuinenotes.com

Parametric Cubic Curve


• To find the tangent vectors equation (ii) must be differentiated with
respect to t

P (t) = a3 t3 + a2 t2 + a1 t + a0

Nipun Thapa (computer Graphics)


P’ (t) = 3 a3 t 2 + 2 a2 t + a1

• The tangent vectors at the two end points are found by


substituting t = 0 and t = 1 in this equation
P’ (0) = a1 P’ (1) = 3 a3 + 2 a2 + a1------------------- (V)

39
https://genuinenotes.com

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)

Nipun Thapa (computer Graphics)


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 40
from 0 to 1 several points on curve segments can be found
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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.
41
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


properties of Bezier blending function: they are positive
and their sum is always 1, i.e.

42
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


43
https://genuinenotes.com

Bezier Curve
This, vector equation represents a set of three parametric
equations for the individual curve coordinates:

Nipun Thapa (computer Graphics)


The Bezier blending functions BEZ k, n (u)
are the Bernstein polynomials:

44
https://genuinenotes.com

Bezier Curve
Now

(n = 3)

Nipun Thapa (computer Graphics)


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

45
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


When u = 0 then P(u) = P0 and
when u =1 then P(u) = P3

P(u)
46
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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

47
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


7. The tangent to the curve at an end point is along the line
joining the end point to the adjacent control point

48
https://genuinenotes.com

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.

Nipun Thapa (computer Graphics)


First calculate all the blending functions, Bkn for k=0,..,n using
the formula:

49
https://genuinenotes.com

Numerical calculations are shown below:

Nipun Thapa (computer Graphics)


50
https://genuinenotes.com

Nipun Thapa (computer Graphics)


51
https://genuinenotes.com

Nipun Thapa (computer Graphics)


52
https://genuinenotes.com
The plot below shows control points (joined with a thin line)
and a Bézier curve with 6 steps

Nipun Thapa (computer Graphics)


53
https://genuinenotes.com
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.

Nipun Thapa (computer Graphics)


54
Q.N.>Construct the https://genuinenotes.com
Bezier curve of order 3 and 4
polygon vertices A(1,1) B(2,3) C(4,3) and D(6,4). (TU
2072)

Nipun Thapa (computer Graphics)


55
https://genuinenotes.com

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

Nipun Thapa (computer Graphics)


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:
56
https://genuinenotes.com

Quadric surfaces

Nipun Thapa (computer Graphics)


57
https://genuinenotes.com

Quadric surfaces

Nipun Thapa (computer Graphics)


58
https://genuinenotes.com

Chapter 5

Nipun Thapa (computer Graphics)


Finished
59

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy