Top Banner
www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek Zimányi Computer Graphics 2 Computer Graphics 2
36

Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

Jan 05, 2016

Download

Documents

Shona McDaniel
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

www.sccg.sk/~zimanyi/lectures/PG

Representation and modeling of 3D objects

(basic concepts)

FMFI UKKatedra počítačovej grafiky

a spracovania obrazu

Marek Zimányi

Computer Graphics 2Computer Graphics 2

Page 2: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

2Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Contents

Polygonal representation Boundary rep. Sweep

Constructive Solid Geometry

Implicit representation F-rep

Spatial subdivision techniques Procedural modeling

Page 3: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

3Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Polygonal representation

Boundary representation (B-Rep) Topological description

Specifies: vertices, edges, faces Geometrical description

Specifies: equation of the surface

Sweep

Page 4: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

4Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation

Polygon and Polygonal Mesh Polyhedron Normals Euler’s formula DCEL

Polygonal representationPolygonal representation

Page 5: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

5Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation

Describing of boundary points set

faces,edges, vertices region, loop, shell,

hole,handle vertices :

V1 = (x1, y1, z1), V2 = (x2, y2, z2), … edges :

h1 = (1, 2), h2 = (2, 3), … faces :

P1 = (1, 2, 3), P2 = (4, 2, 1), …

Polygonal representationPolygonal representation

Page 6: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

6Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation - Mesh

Collection of faces (polygons) Advance: shading process Parameters:

Vertices, faces, normals Vertex normals versus face

normals ! This it not the same !

Polygonal representationPolygonal representation

Page 7: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

7Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation - Mesh

Definition: Set of vertices, Normals Faces,

With Indexes of vertices With Indexes of normals

Be careful -> left or right hand CS

Page 8: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

8Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation - Mesh

Normal computing:

1

0)()( ))((

N

iinextiinextix zzyym

1

0)()( ))((

N

iinextiinextiy xxzzm

1

0)()( ))((

N

iinextiinextiz yyxxm

)()( 2321 VVVVm

Martin Newell method:

Page 9: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

9Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary representation - Mesh

Properties Solidity – enclose a positive and finite

amount of space Connectedness – exist unbroken path

between any two vertices Simplicity – solid with no holes Planarity – every face is a planar

polygon Convexity – line between any two

point lies inside the object

Page 10: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

10Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Boundary rep. - Polyhedron

Def.: A polyhedron is a connected mesh of

simple planar polygons that enclose a finite amount of space

Polygonal representationPolygonal representation

Prop. Every edge is shared by exactly two

faces At least 3 edges meets at each

vertex Faces do not interpenetrate:

Page 11: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

11Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Manifolds

2-manifolds: point from manifold has small neighborhood of points around, topologically the same as a disk in the plane

Orientable <-> NonOrientable manifoldMobius strip, Klein bottle

Many b-rep systems support only solid whose boundaries are 2-manifold

Polygonal representation - B-repPolygonal representation - B-rep

Unreal objects => Non-Manifolds

Page 12: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

12Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Manifolds

Klein bottle http://www.math.ohio-state.edu/~fiedorow/math655/Klein2.html http://www.kleinbottle.com/

Mobius strip http://www.mobiusproductsandservices.com/tms.html http://www.cut-the-knot.org/do_you_know/moebius.shtml

Another :-) http://pbskids.org/zoom/phenom/index.html

Polygonal representation - B-repPolygonal representation - B-rep

Page 13: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

13Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Non-Manifolds

Page 14: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

14Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

The Winged-Edge Representation

Double-connected Edge List (DCEL)For each edge is given info:1. Incident vertices2. Left and right adjacent face3. Preceding and succeeding edge in clockwise

order4. Preceding and succeeding edge in

counterclockwise order

Polygonal representation - B-repPolygonal representation - B-rep

Page 15: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

15Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

B-Rep

Important facts in the B-Rep: Classification of edges

sharp and auxiliary Normals in vertexes Boundary of face –

find all edges of a face Position of a point in the space

Point is IN or OUT of object

Polygonal representationPolygonal representationPolygonal representation - B-repPolygonal representation - B-rep

Page 16: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

16Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Sweep

Sweeping an object along a trajectory Translation sweep Rotational sweep Conical sweep Sphere sweep General Cylinder

Polygonal rep ?

Polygonal representationPolygonal representation

Page 17: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

17Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Translational Sweep

Method:Define the object with the contour (2D) and the

path.

Polygonal representationPolygonal representation

Page 18: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

18Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Rotational SweepMethod:

Define the object by rotating of the contour (2D) with the arbitrary axis.

Polygonal representationPolygonal representation

Page 19: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

19Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Conical SweepMethod:

Define the object by the contour (2D) and a 3D-point (top of the pyramide).

Polygonal representationPolygonal representation

Page 20: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

20Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Sphere SweepMethod:

Define the object by the sphere with the varying radius and a path.

Polygonal representationPolygonal representation

Page 21: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

21Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

General CylinderMethod:

Define the object by the set of „control“-contours and by the path.

Polygonal representationPolygonal representation

Page 22: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

22Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Polygonal rep ?

General sweeps – difficult to model efficiency

General sweeps do not always generate solids

It is a polygonal rep?

Polygonal representationPolygonal representation

Yes and No.

Trajectory and object shape – may swept object intersect

Volume calculations complicated

Sweeping a 2D area in its own plane

another 2D area

Page 23: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

23Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Polygonal rep ?

It is a difficult to apply regularized Boolean operations(after BOOL op. it wouldn’t be SWEEP obj)

BUT sweeps are a natural and intuitive way to construct of the objects

Many systems allow user construct sweepsBUT

Polygonal representationPolygonal representation

store the objects in other representation

Page 24: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

24Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Constructive Solid Geometry

CSG Composing of Primitives: Sphere, Cone, Cube, Cylinder, ... Operations: , , -, ... The leafs of CSG-tree are primitives

and the operations are in the rest of the tree nodes. The CSG-tree represents the solid. (Scene graph idea!)

Page 25: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

25Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Example

Polygonal representation - CSGPolygonal representation - CSG

Page 26: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

26Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Page 27: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

27Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Notes

Pros Low memory consumption Simple combining Exact representation of complex

surfaces 12 Mantylas operators and his proof

Cons Slow and difficult processing

? Not unique representation

Polygonal representation - CSGPolygonal representation - CSG

Page 28: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

28Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

CSG processing

Rendering Algorithms ray casting (tracing) extended depth buffer algorithm

Evaluation/Conversion Algorithms boundary representation octree constructive cubes

Polygonal representation - CSGPolygonal representation - CSG

Page 29: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

29Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Implicit representation

Jim Blinn 1982 Implicit surfaces

Blobby objects Soft objects Meta balls

Page 30: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

30Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Spreadsheet RenderingImplicit representationImplicit representation

Page 31: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

31Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Animation Path in t1t2 PlaneImplicit representationImplicit representation

Page 32: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

32Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Spatial subdivision techniques

Octrees Iterative space subdivision Nodes have property: V, F or M Subdividing P-nodes until the desired

Approximation Quality The dividing planes do not depend on

objects in the scene (differs from BSP tree!)

Analogy in 2D: „Quad Tree“ BSP trees

Page 33: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

33Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Octree

Sort form of space Disadvantage: sampling

V – void

F – full

M – mixed

 

(FFFFF(FFFVFVFV)VV)

Spatial subdivision techniquesSpatial subdivision techniques

Page 34: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

34Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Octree Boolean set operations and

transformations Traverse both trees top-down in

parallel Rotations (*90), scaling (*2) General transformations – severe

problem(aliasing)

Neighbor finding Not trivial

Linear notation

Spatial subdivision techniquesSpatial subdivision techniques

Page 35: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

35Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Binary Space-Partitioning Trees (BSP trees)

octrees divide space uniformly - drawback BSP divide space recursively into pairs of

subspaces: each subspace has the same object complexity

(# of objects) Usual division step:

1. sort the objects according to actual coordinate (x,y,z)

2. Choose median3. Place halfplane (halfline in 2D) between median

and next object4. Shift halfline if too many objects intersects

the halfplane

Spatial subdivision techniquesSpatial subdivision techniques

Page 36: Www.sccg.sk/~zimanyi/lectures/PG Representation and modeling of 3D objects (basic concepts) FMFI UK Katedra počítačovej grafiky a spracovania obrazu Marek.

36Marek Zimányi,Department of Computer Graphics

and Image Processing, FMPI, Comenius University, Bratislava Marek Zimányi, Andrej Ferkowww.uniba.sk/~kpgso

Procedural modeling

Alternative to slow user modeling Useful for complex, hard-to-manipulate,

organic, fuzzy, scalable, large, … objects Software designer prepares a procedure,

implementing object-production algorithm Software user specifies only the input

parameters for the procedure Stochastic principle is often applied

(no 2 trees are exactly identical)