Documente Academic
Documente Profesional
Documente Cultură
Chapter 7
3D Object Modeling
1
3D Object Representation
A surface can be analytically
generated using its function
y = f(x,z)
involving the coordinates.
An object can be represented in
x y z ...
terms of its vertices, edges and
polygons. (Wire Frame,
Polygonal Mesh etc.)
Curves and surfaces can also be
designed using splines by
specifying a set of few control
points.
2
Solid Modeling - Polyhedron
A polyhedron is a connected mesh of simple planar
polygons that encloses a finite amount of space.
A polyhedron is a special case of a polygon mesh that
satisfies the following properties:
Every edge is shared by exactly two faces.
At least three edges meet at each vertex.
Faces do not interpenetrate. Faces at most touch
along a common edge.
Euler’s formula : If F, E, V represent the number of
faces, vertices and edges of a polyhedron, then
V + F E = 2.
3
3D Object Representation
Method 2:
Vertex List
Edge List
5
6 7
2 3
4
Vertex Index
5
Face Index
Data representation using vertex, face and normal lists:
6
Data representation using vertex, face and edge lists:
30 30 30 0 1 0 1 2 3
-30 30 30 1 2 4 7 6 5
-30 -30 30 2 3 0 4 5 1
30 -30 30 3 0 1 5 6 2
30 30 -30 4 5 2 6 7 3
-30 30 -30 5 6 3 7 4 0
-30 -30 -30 6 7
30 -30 -30 7 4
0 4
1 5
2 6
3 7
7
Normal Vectors (OpenGL)
Assigning a normal vector to a polygon:
glBegin(GL_POLYGON);
glNormal3f(xn,yn,zn);
glVertex3f(x1,y1,z1);
glVertex3f(x2,y2,z2);
glVertex3f(x3,y3,z3);
glVertex3f(x4,y4,z4);
glEnd();
glEnable(GL_NORMALIZE);
8
Regular Polyhedra (Platonic Solids)
If all the faces of a polyhedron are
identical, and each is a regular polygon,
then the object is called a platonic solid.
Only five such objects exist.
9
Wire-Frame Models
10
Wire Frame Models - OpenGL
11
Wire Frame Model - The
Teapot
12
Polygonal Mesh
Three-dimensional surfaces and solids can be
approximated by a set of polygonal and line
elements. Such surfaces are called polygonal
meshes.
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.
13
Polygonal Mesh - Example
14
Solid Modeling
15
Solid Modeling - Example
16
Solid Modeling - OpenGL
17
Surface Modeling
Y
y = f(x, z)
Z
Many surfaces can be represented by an explicit function of
two independent variables, such as y = f(x, z).
18
Surface Modeling - Example
19
Sweep Representations
20
Extruded Shapes - Examples
A polyhedron obtained
by sweeping (extruding)
a polygon along a
straight line is called a
prism. 21
Surface of Revolution
22
Surface of Revolution
Y
y = f(x)
y = f(r)
y y
x
r X
(x, z)
Z
r x z2 2
23
Surface of Revolution
y f x2 z2
24
Surface of Revolution
y
sin( x)
sin x z
2 2
x
y
x z
2 2
25
Quad trees
Quad trees are generated by successively
dividing a 2-D region(usually a square) into
quadrants. Each node in the quadtree has
4 data elements, one for each of the
quadrants in the region. If all the pixels
within a quadrant have the same color (a
homogeneous quadrant), the
corresponding data element in the node
stores that color. For a heterogeneous
region of space, the successive divisions
into quadrants continues until all quadrants
are homogeneous.
26
Octrees
An octree encoding scheme divide regions of
3-D space(usually a cube) in to octants and
stores 8 data elements in each node of the
tree.
Individual elements of a 3-D space are called
volume elements or voxels.
When all voxels in an octant are of the same
type, this type value is stored in the
corresponding data element of the node. Any
heterogeneous octant is subdivided into
octants and the corresponding data element
in the node points to the next node in the
octree.
27
Octrees
28
Bezier Curves
0 u 1
m i m i m m!
Bezm , i (u ) u (1 u ) and
i i i ! m i !
30
Bezier Curves
m
r (u ) Bezm i (u )ri , 0 u 1
i 0 i
where
r (u ) ( x(u ), y (u ))
ri ( xi , yi )
31
Properties of Bezier Curve
p0
p2
p0
p2
32
Quadratic Curve Cubic Curve
Properties of Bezier Curve (cont.)
x(0) x0 y(0) y0
x(1) xm
and y (1) ym
33
Properties of Bezier Curve
(cont)
The slop at the beginning of the curve is
along the line joining the first two control
points, and the slope at the end of the
curve is along the line joining the last two
points. p
1
p2
p0
34
Properties of Bezier Curve
(cont)
Bezier blending functions are all positive
and the sum is always 1.
m
Bez
i 0
m, i (u ) 1
35
Design Technique using Bezier
Curves:
A closed Bezier curve can be generated by
specifying the first and last control points at
the same location
p3
p2
p4
p1 p0=p5
36
Design Technique (Cont)
p0 p4
37
Bezier curve can be form by piecing of
several Bezier section with lower degree.
p1
p0
p’1 p’2
38
Bezier Surfaces
(Not Important!)
m l
r (u , v) Bezm i (u ) Bezl , j (v)ri j ,
i 0 j 0
0 u 1, 0 v 1
where
r (u , v) ( x(u, v), y (u, v), z (u, v))
rij ( xij , yij , zij )
39
Bezier Patch
40
Bezier Patch
Utah Teapot Defined Using Control Points
41
Bezier Patch
Utah Teapot Generated Using Bezier Patches
42