You are on page 1of 23

Unit 3: 3D Object representation

1
Introduction
• Graphics scene can contain many various kinds of objects: like trees, water,

rocks, etc.

• To produce realistic display of scenes, we need to use representations that

accurately model object characteristics.

– Curves and Surface modeling: is the representation of curves and

surfaces (a simple generalization of curves) with geometric shapes that


are easy to describe mathematically.

– Solid modeling: is the of volumes completely

representation surrounded by surfaces.

2
Representing curves and surfaces
• Smooth curves and surfaces must be generated in many computer

graphics applications e.g., CAD.

• The need to represent curves and surfaces arises in two cases:

– In modeling existing objects, and

– In modeling from scratch (no preexisting physical object)

• Three most common representations for 3D surfaces are:

– Polygon meshes

– Parametric surfaces, and

– Quadric surfaces.
3
Contd…
Polygon tables:

– A convenient organization for storing geometric data is to create 3


lists:
• vertex table: stores co-ordinates of each vertex in the polygon.

• edge table : stores the Edge information of each edge of polygon i.e.,
vertex pair for each edge.

• surface table: stores the surface information for each surface i.e., edge list

for each surface.

5
2D & 3D Difference
For 2D for each coordinates or vertices it has two value i.e. X,Y
For 3D for each coordinates or vertices it has three value i.e. X,Y,Z
Contd…
• Consider the surface containing polygonal facets as shown
in figure:

Vertex Table Edge Table


S1 and S2 are two polygon E1: V1, V2
V1 V1: x1, y1, z1
surface that represent the boundary V2: x2, y2, E2: V2,
z2 V3: V3 E3:
of some 3D object. V3, V1
x3,y3,z3 V4:
x4, y4, z4 E4: V3, V4
E1 V5: x5, y5, z5 E5: V4,
E3 E6 V5 E6:
V5, V1
Polygon Surface Table
V5
V3 S1: E1, E2, E3
V2 E5 S2: E3, E4, E5, E6
E2
E4

V4
F2i/g9/u2r0e19: Geometric data table representation for two adjacent polygon 6
surfaces.
Contd…
• Polygon meshes: A polygon mesh is collection of edges, vertices and

polygons connected such that:

– each edge is shared by at most two polygons.

– An edge connects two vertices

– a vertex is shared by at least two edges.

– a polygon is a closed sequence of edges.

Figure: Triangular Mesh Fig: quadrilateral mesh


8
Contd….

• A polygon mesh can be represented in


three

ways:

– Explicit

– Pointer to vertex list and

– Pointer to an edge list

9
Contd…
• In explicit representation, each polygon is represented by a list of vertex co-
ordinates.

P  x 1 , y 1 , z 1 ,  x 2 , y 2 , z 2 , . . . . ,  x n , y n , z n 

• The vertices are stored in the order of traveling around the


polygon.

• There are edges between successive vertices in the list and between the last and
first vertices.

1
0
Continue..
• Representing polygon mesh with each polygon as vertex list.

P1  {v 1 , v 2 ,v 5 }
P2  {v 2 ,v 3 , v 5 }
P3  {v 3 , v 4 ,v 5 } V4
V5
V1 P3

P1
P2
V3
V2

• Here most of the vertices are duplicated so it


is not efficient.
10
Continue..
• So another method is to define polygon with pointers
to a vertex list.
• So each vertex is stored just once, in vertex list

V  {v1, v2 , v3 ,......,v n }
 {(x 1 , y1, z1 ),(x 2 , y 2 , z 2 ),....,(x 5 , y5 , z5 )}
P1 {1,2,5}
P2  {2,3,5}
P3  {3,4,5}

11
Contd…
• pointers to an edge list:
– This method represent the polygon as a list of pointers to an edge list.

– Each edge in edge list points to the two vertices in the vertex list.

– Hence we describe polygon as;

P  {E1 , E 2 , E3 ,....,En }
An d an Edge as;
E  { v 1 , v 2 , P1 ,
P2 }

– If edge belongs to only one


polygon, then either P1 or P2 is
null. 13
Continue..
• For the mesh given below,

14
Contd…
Plane Equations:
– Equation of the plane in which polygon or polygon meshes lies.

– Used to find the position of spatial points relative to the plane

surfaces of an object.

– Obtained by the vertex coordinate and the equation of the plane.

15
Contd….
• The equation for a plane surface can be expressed in

the form:

Ax + By + Cz + D = 0

– Where (x, y, z) is any point on the plane, and A, B, C, D are

constants describing the spatial properties of the plane.

– The values of A, B, C, D can be obtained by solving

a set of three plane equations using co-ordinate values of 3

non- collinear points on the plane.

15
Contd…
• Let (x1, y1, z1), (x2, y2, z2) and (x3, y3, z3) are
three

points on the plane, then,


– Ax1 + By1 + Cz1 + D = 0

– Ax2 + By2 + Cz2 + D = 0

– Ax3 + By3 + Cz3 + D = 0


• General form of the equation is;
– (A/D)xk+(B/D)yk+(C/D)zk=-1 where, k=1,2,3.

17
Contd…
• The solution of these equations can be obtained in determinant
form using Cramer’s rule as:-
1 y1 z1
A  1 y 2 z 2 ,
1 y 3 z3
x1 1 z1
B  x 2 1 z 2 ,
x3

z3
x1 y1 z1
x1
D   x 2 y 2 z 2

y1 x 3 y 3 z 3

18
1
Continue..
• Expanding the above matrices so, plane
coefficients are:
A  y 1 ( z 2  z 3 )  y 2 ( z 3  z 1 )  y 3 (z 1  z 2 )

B  z 1 ( x 2  x 3 )  z 2 ( x 3  x 1 )  z 3 (x 1  x 2 )

C  x1 ( y 2  y 3 )  x 2 ( y 3  y1 )  x 3 ( y1  y 2 )

D   x 1 ( y 2 z 3  y 3 z 2 )  x 2 ( y 3 z1  y1 z 3 )  x 3 ( y1 z 2 
y 2 z1 )

19
Continue..
• For any points (x, y, z);
– If Ax + By + Cz + D ≠0, then (x, y, z) is not on the plane.
• If Ax + By + Cz + D < 0, then (x, y, z) is inside the surface (The side of the
plane that faces the object interior)
• If Ax + By + Cz + D > 0, then (x, y, z) is lies out side the surface (outward
side ).

20
Quadric Surface
• 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:

21
Contd…
1. Sphere:
For the set of surface points (x, y, z) the spherical surface is
represented as: x2+y2+z2 = r2, with radius r and centered at
co-ordinate origin.

2.
Ellipsoid:
x2 y2 z 2

 
a2 b2 c2 1
where (x, y, z) is the surface points and a, b, c are the
radii on X, Y and Z directions respectively.
22
Contd….
3. Elliptic Paraboloid
2
2  y
x  z
2 2
a b

4. Hyperbolic Paraboloid
2
2  y
x  z
2 2
a b
2
5. Elliptic Cone x2  y
2
  0
z
a2 b2 c2 22

You might also like