solid modeling. solid modeling - polyhedron a polyhedron is a connected mesh of simple planar...

Post on 05-Jan-2016

223 Views

Category:

Documents

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Solid Modeling

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.

2

3D Object Representation

• The data for polygonal meshes can be represented in two ways.– Method 1:

• Vertex List• Normal List• Face List (Polygon List)

– Method 2:• Vertex List• Edge List• Face List (Polygon List)

3

4

01

2 3

45

6 7

Vertices and Faces - E.g. CubeVertices and Faces - E.g. Cube

0

1

23

4

5

Face Index

Vertex Index

6

5

Data representation using vertex, face and normal lists:

Vertex List Normal List Polygon List

30 30 30 0.0 0.0 1.0 0 1 2 3-30 30 30 0.0 0.0 -1.0 4 7 6 5-30 -30 30 0.0 1.0 0.0 0 4 5 1 30 -30 30 -1.0 0.0 0.0 1 5 6 2 30 30 -30 0.0 -1.0 0.0 2 6 7 3-30 30 -30 1.0 0.0 0.0 3 7 4 0-30 -30 -30 30 -30 -30

6

Vertex List Edge List Polygon Listx[i] y[i] z[i] L[j] M[j] P[k] Q[k] R[k] S[k]

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 41 52 63 7

Data representation using vertex, face and edge lists:

Normal Vectors (OpenGL)

7

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();

Enabling automatic conversion of normal vectors to unit vectors:

glEnable(GL_NORMALIZE);

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.

8

Wire-Frame Models

• If the object is defined only by a set of nodes (vertices), and a set of lines connecting the nodes, then the resulting object representation is called a wire-frame model.

– Very suitable for engineering applications.

– Simplest 3D Model - easy to construct.

– Easy to clip and manipulate.

– Not suitable for building realistic models.

9

Wire Frame Models - OpenGL

10

Some Wireframe Models in OpenGL:Cube: glutWireCube(Gldouble size);Sphere: glutWireSphere(…);Torus: glutWireTorus(…);Teapot: glutWireTeapot(Gldouble size);Cone: glutWireCone(…);

(…) Refer text for list of arguments.

Wire Frame Model - The Teapot

11

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.

12

Polygonal Mesh - Example

13

Solid Modeling

• Polygonal meshes can be used in solid modeling.• An object is considered solid if the polygons fit together to

enclose a space.• In solid models, it is necessary to incorporate directional

information on each face by using the normal vector to the plane of the face, and it is used in the shading process.

14

Solid Modeling - Example

15

Solid Modeling - OpenGL

16

Some predefined Solid Models in OpenGL: Cube: glutSolidCube(Gldouble size); Sphere: glutSolidSphere(…); Torus: glutSolidTorus(…); Teapot: glutSolidTeapot(Gldouble size); Cone: glutSolidCone(…); (…) Arguments same as wire-frame models.

Sweep Representations

• Sweep representations are useful for both surface modeling and solid modeling.

• A large class of shapes (both surfaces and solid models) can be formed by sweeping or extruding a 2D shape through space.

• Sweep representations are useful for constructing 3-D objects that posses translational or rotational symmetries.

17

Extruded Shapes - Examples

18

A polyhedron obtained by sweeping (extruding) a polygon along a straight line is called a prism.

Quad treesQuad trees are generated by successively dividing a 2-D

region(usually a square) into quadrants. Each node in the quad tree 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.

19

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.

20

Octrees

21

top related