3d objects representations · 1 3/6/2006 © ariel shamir 1 3d objects representations aa rr iieel...

26
1 3/6/2006 © Ariel Shamir 1 3D Objects Representations Ariel Shamir Ariel Shamir Ariel Shamir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations Representation schemes overview Samples: point clouds & images Introduction Introduction Simple geometry & representations Simple geometry & representations Representation schemes overview Representation schemes overview Samples: point clouds & images Samples: point clouds & images

Upload: others

Post on 15-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

1

3/6/2006 © Ariel Shamir 1

3D Objects Representations

Ariel ShamirAriel ShamirAriel Shamir

3/6/2006 © Ariel Shamir 2

OverviewIntroduction

Simple geometry & representations

Representation schemes overview

Samples: point clouds & images

IntroductionIntroduction

Simple geometry & representationsSimple geometry & representations

Representation schemes overviewRepresentation schemes overview

Samples: point clouds & imagesSamples: point clouds & images

Page 2: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

2

3/6/2006 © Ariel Shamir 3

Why 3D Objects?Get acquainted with modeling of objects that have a physical counterpart in the real world.A super set of 1 & 2 dimensions.Possible to check if the model is good.(Good in what sense? What properties do we want to model?).

Get acquainted with modeling of Get acquainted with modeling of objects that have a physical objects that have a physical counterpart in the real world.counterpart in the real world.A super set of 1 & 2 dimensions.A super set of 1 & 2 dimensions.Possible to check if the model is good.Possible to check if the model is good.(Good in what sense? What (Good in what sense? What properties do we want to model?).properties do we want to model?).

3/6/2006 © Ariel Shamir 4

ModelingPhysical Object

Physical Properties

Mathematical Model

Computer Representation

Math Model of Properties

Representation Attributes

Page 3: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

3

3/6/2006 © Ariel Shamir 5

Operations“Tell me what you can do and I’ll tell you what you are”

Many times a model is defined by it’s possible operations. Mainly there are two kinds of operations:• Synthesis operations (creation, modify effect)

• Queries (no effect)

““Tell me what you can do and ITell me what you can do and I’’ll tell you ll tell you what you arewhat you are””

Many times a model is defined by itMany times a model is defined by it’’s s possible operations. Mainly there are two possible operations. Mainly there are two kinds of operations:kinds of operations:•• Synthesis operations (creation, modify effect)Synthesis operations (creation, modify effect)

•• Queries (no effect)Queries (no effect)

3/6/2006 © Ariel Shamir 6

Operation Optimization• Much like any other ADT and data

structures, sometimes a specific representation will give preference to specific operations over others.

• You must consider what operations are most crucial to your needs.

• A central one in our view is: rendering!

•• Much like any other ADT and data Much like any other ADT and data structures, sometimes a specific structures, sometimes a specific representation will give preference to representation will give preference to specific operations over others.specific operations over others.

•• You must consider what operations are You must consider what operations are most crucial to your needs.most crucial to your needs.

•• A central one in our view is: rendering!A central one in our view is: rendering!

Page 4: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

4

3/6/2006 © Ariel Shamir 7

Model & Operations Wish List• Cover large enough domain

• Unambiguous

• Unique

• Accurate

• Not possible to create invalid objects

• Closure under some operations

• Easy to create and maintain

• Compact (space)

• Efficient (time)

•• Cover large enough domainCover large enough domain

•• UnambiguousUnambiguous

•• UniqueUnique

•• AccurateAccurate

•• Not possible to create invalid objectsNot possible to create invalid objects

•• Closure under some operationsClosure under some operations

•• Easy to create and maintainEasy to create and maintain

•• CompactCompact (space)(space)

•• EfficientEfficient (time)(time)

3/6/2006 © Ariel Shamir 8

Object Representations Schemes in 3DSamples:• Point Clouds

• Images

Boundary:• Implicit

• Parametric

• Meshes

• Subdivision

Samples:Samples:•• Point CloudsPoint Clouds

•• ImagesImages

Boundary:Boundary:•• ImplicitImplicit

•• ParametricParametric

•• MeshesMeshes

•• SubdivisionSubdivision

Volume:• Voxels

• Octree

• BSP

High Level:• CSG

• Skeleton, Sweep

• Scene Graph

• Constraints

• Feature Based

Volume:Volume:•• VoxelsVoxels

•• OctreeOctree

•• BSPBSP

High Level:High Level:•• CSGCSG

•• Skeleton, SweepSkeleton, Sweep

•• Scene GraphScene Graph

•• ConstraintsConstraints

•• Feature BasedFeature Based

Page 5: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

5

3/6/2006 © Ariel Shamir 9

Point CloudsA collection of points & attributes:• Position (the definition of point).

• Scalar: color, heat, pressure…

• Vector: normal, speed…

Can be gathered by range sampling or defined in a simulation (mesh) etc.

A collection of points & A collection of points & attributes:attributes:•• Position (the definition of point).Position (the definition of point).

•• Scalar: color, heat, pressureScalar: color, heat, pressure……

•• Vector: normal, speedVector: normal, speed……

Can be gathered by range Can be gathered by range sampling or defined in a sampling or defined in a simulation (mesh) etc.simulation (mesh) etc.

3/6/2006 © Ariel Shamir 10

Images As Special CaseAll images can in fact be seen as point sample representation of some function, but they are mostly defined on planar regular grids and we can assume some blending function which defines some function on the whole space.

All images can in fact be seen All images can in fact be seen as point sample representation as point sample representation of some function, but they are of some function, but they are mostly defined on planar mostly defined on planar regular grids and we can regular grids and we can assume some blending function assume some blending function which defines some function which defines some function on the whole space.on the whole space.

Page 6: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

6

3/6/2006 © Ariel Shamir 11

Boundary RepresentationA (closed) object can be defined by the representation of its boundary.

The boundary defines what is inside (a part of) the object, and what is outside.

Instead of representing a volume (3D object) we resolve to representing a surface.

A (closed) object can be defined by the A (closed) object can be defined by the representation of its boundary.representation of its boundary.

The boundary defines what is inside (a The boundary defines what is inside (a part of) the object, and what is outside.part of) the object, and what is outside.

Instead of representing a volume (3D Instead of representing a volume (3D object) we resolve to representing a object) we resolve to representing a surface.surface.

3/6/2006 © Ariel Shamir 12

SurfacesIn 3D any boundary of a volume will be a 2D surface entity (limiting one degree of freedom), however not all surfaces are boundary of objects!http://www.math.hmc.edu/faculty/gu/curves_and_surfaces/

In 3D any boundary of a In 3D any boundary of a volume will be a 2D surface volume will be a 2D surface entity (limiting one degree of entity (limiting one degree of freedom), however not all freedom), however not all surfaces are boundary of surfaces are boundary of objects!objects!http://www.math.hmc.edu/faculty/gu/curves_and_surfaces/

Page 7: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

7

3/6/2006 © Ariel Shamir 13

OrientabilityThe Möbius strip is an example of non-orientablesurface. When we define a surface normal at a point, it is impossible to extend the definition to the whole surface. Thus, any attempt to give the surface a "front" and a "back" must fail!

The The MMööbiusbius strip is an strip is an example of nonexample of non--orientableorientablesurface. When we define a surface. When we define a surface normal at a point, it surface normal at a point, it is impossible to extend the is impossible to extend the definition to the whole definition to the whole surface. Thus, any attempt to surface. Thus, any attempt to give the surface a "front" and give the surface a "front" and a "back" must fail!a "back" must fail!

3/6/2006 © Ariel Shamir 14

Explicit Representationy = f(x) or z = f(x,y) give an explicit representation of a curve or surface (the connection between the variables is explicit)Limitations:• Cannot have one to many mapping

• Cannot bound a volume

• Many surfaces cannot be defined explicitly

y = f(x)y = f(x) or or z = f(x,y)z = f(x,y) give an explicit give an explicit representation of a curve or surface (the representation of a curve or surface (the connection between the variables is connection between the variables is explicit)explicit)

Limitations:Limitations:•• Cannot have one to many mappingCannot have one to many mapping

•• Cannot bound a volumeCannot bound a volume

•• Many surfaces cannot be defined explicitlyMany surfaces cannot be defined explicitly

Page 8: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

8

3/6/2006 © Ariel Shamir 15

Implicit RepresentationThe object boundary is defined using an implicit function f(x,y,z) = 0.

For example:• Ax+By+Cz+D = 0 a half-space

(plane)

• Ax2+By2+Cz2-D = 0 an ellipsoid

The object boundary is The object boundary is defined using an implicit defined using an implicit function f(x,y,z) = 0. function f(x,y,z) = 0.

For example:For example:•• Ax+By+Cz+DAx+By+Cz+D = 0 a half= 0 a half--space space

(plane)(plane)

•• AxAx22+By+By22+Cz+Cz22--D = 0 an ellipsoidD = 0 an ellipsoid

3/6/2006 © Ariel Shamir 16

Point ClassificationPoints can be classified easily with respect to the object. Given p0 = (x0,y0,z0) you evaluate f(p0) and check its sign or if it is equal to 0.Ax0+By0+Cz0+D = 0 � p0 is on the plane

Ax0+By0+Cz0+D < 0 � p0 is on the left side

Ax0+By0+Cz0+D < 0 � p0 is on the right side

This also allows easy inside/outside tests!

Points can be classified easily with respect Points can be classified easily with respect to the object. to the object.

Given pGiven p00 = (x= (x00,y,y00,z,z00) you evaluate f(p) you evaluate f(p00) and ) and check its sign or if it is equal to 0.check its sign or if it is equal to 0.AxAx00+By+By00+Cz+Cz00+D = 0 +D = 0 �� pp00 is on the planeis on the plane

AxAx00+By+By00+Cz+Cz00+D < 0 +D < 0 �� pp00 is on the left sideis on the left side

AxAx00+By+By00+Cz+Cz00+D < 0 +D < 0 �� pp00 is on the right sideis on the right side

This also allows easy inside/outside tests!This also allows easy inside/outside tests!

Page 9: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

9

3/6/2006 © Ariel Shamir 17

Algebraic SurfacesWhen f(p) is polynomial the corresponding implicit surface is called an algebraic surface.

Quadrics are algebraic surfaces of second degree.Ax2 + Bxy + Cxz + Dy2 + Eyz + Fz2 + Gx + Hy + Iz + J = 0

When f(p) is polynomial the When f(p) is polynomial the corresponding implicit surface is corresponding implicit surface is called an called an algebraic surfacealgebraic surface..

QuadricsQuadrics are algebraic surfaces of are algebraic surfaces of second degree.second degree.Ax2 + Bxy + Cxz + Dy2 + Eyz + Fz2 + Gx + Hy + Iz + J = 0

3/6/2006 © Ariel Shamir 18

Quadrics

Page 10: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

10

3/6/2006 © Ariel Shamir 19

DeficiencyWhat operation is hard using implicit representation?Enumeration.Find all points that belong to the object (or to the boundary). For example for visualizing.Even when given x it might be hard to find all (if any) y & z that satisfy the equation.

What operation is hard using implicit What operation is hard using implicit representation?representation?

Enumeration.Enumeration.

Find all points that belong to the object Find all points that belong to the object (or to the boundary). For example for (or to the boundary). For example for visualizing.visualizing.

Even when given x it might be hard to find Even when given x it might be hard to find all (if any) y & z that satisfy the equation. all (if any) y & z that satisfy the equation.

3/6/2006 © Ariel Shamir 20

Parametric RepresentationGiven a parameter space U, a parametric representation is a map between parameter value u����U to a point in the geometric space G.

A curve in 3D can be defined as

C(x,y,z) = (x(u),y(u),z(u))

Given a parameter space U, a Given a parameter space U, a parametric representation is a map parametric representation is a map between parameter value ubetween parameter value u��������U to a U to a point in the geometric space G.point in the geometric space G.

A curve in 3D can be defined as A curve in 3D can be defined as

C(x,y,z) = (x(u),y(u),z(u))C(x,y,z) = (x(u),y(u),z(u))

Page 11: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

11

3/6/2006 © Ariel Shamir 21

Example: Parametric SegmentGiven two points P0 , P1���� R3 we define for U=[0,1] G=R3

C(x,y,z) = ((1-u)x1 + ux0 , (1-u)y1 + uy0, (1-u)z1 + uz0)Or in short notation:(1-u)P1 + uP0

Given two points PGiven two points P0 0 , P, P11�������� RR33 we define for we define for U=[0,1] U=[0,1] G=RG=R33

C(x,y,z) = C(x,y,z) = ((1((1--u)xu)x11 + ux+ ux00 , (1, (1--u)yu)y11 + uy+ uy0, 0, (1(1--u)zu)z11 + uz+ uz00))

Or in short notation:Or in short notation:

(1(1--u)Pu)P11 + uP+ uP00PP11

PP00

0 1

3/6/2006 © Ariel Shamir 22

Bezier Patch (Surface)We need a net of points

N by M points define a surface

http://www.cse.ogi.edu/~andy/applets/bezier.htmhttp://www.ip.info.hiro.kindai.ac.jp/cai/caiJ/RBezier_Surface_e.html

http://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/cs490-96to97/anson/BezierPatchApplet/

We need a net of pointsWe need a net of points

N by M points define a surfaceN by M points define a surface

http://http://www.cse.ogi.edu/~andy/applets/bezier.htmwww.cse.ogi.edu/~andy/applets/bezier.htmhttp://www.ip.info.hiro.kindai.ac.jp/cai/caiJ/RBezier_Surface_e.http://www.ip.info.hiro.kindai.ac.jp/cai/caiJ/RBezier_Surface_e.htmlhtml

http://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/cshttp://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/cs490490--96to97/anson/BezierPatchApplet/96to97/anson/BezierPatchApplet/

Page 12: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

12

3/6/2006 © Ariel Shamir 23

Why “Patches”Modeling complex object requires high degrees of freedom and change of curvature, minimum & maximum points and regions, saddles etc.

Using one surface is numerically difficult and practically impossible!

Modeling complex object Modeling complex object requires high degrees of requires high degrees of freedom and change of freedom and change of curvature, minimum & curvature, minimum & maximum points and maximum points and regions, saddles etc.regions, saddles etc.

Using one surface is Using one surface is numerically difficult and numerically difficult and practically impossible!practically impossible!

3/6/2006 © Ariel Shamir 24

Solution: Use Patches!Each patch has its own frame of points, and degrees of freedom.

The main difficulty is continuity between patches!

Each patch has its Each patch has its own frame of own frame of points, and degrees points, and degrees of freedom.of freedom.

The main difficulty The main difficulty is continuity is continuity between patches!between patches!

Page 13: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

13

3/6/2006 © Ariel Shamir 25

Locality of Patches

3/6/2006 © Ariel Shamir 26

Computer Rendering

Page 14: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

14

3/6/2006 © Ariel Shamir 27

The Graphics Rendering Pipeline

3/6/2006 © Ariel Shamir 28

Visibility & ShadingIn terms of converting a 3D scene to a 2D image, one can think of two basic rendering tasks:• Visibility determination: what is visible

and what is occluded.

• Shading: what is the color of each visible 3D element (and 2D pixel)

In terms of converting a 3D scene to a In terms of converting a 3D scene to a 2D image, one can think of two basic 2D image, one can think of two basic rendering tasks:rendering tasks:•• Visibility determination: what is visible Visibility determination: what is visible

and what is occluded.and what is occluded.

•• Shading: what is the color of each visible Shading: what is the color of each visible 3D element (and 2D pixel)3D element (and 2D pixel)

Page 15: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

15

3/6/2006 © Ariel Shamir 29

3D Projection & 2D Rasterization

Virtual World Models

Projection

Rasterization

RasterScreen

Hardware support for triangles!

3/6/2006 © Ariel Shamir 30

Basic Display PrimitivesThe rendering pipeline supports two basic

display primitives:1. Pixels (e.g. from images) are used

directly or combined into the image.2. Polygon (usually triangle) are

converted to pixels using vertex information by rasterization and interpolation.

The rendering pipeline supports two basic The rendering pipeline supports two basic display primitives:display primitives:

1.1. Pixels (e.g. from images) are used Pixels (e.g. from images) are used directly or combined into the image.directly or combined into the image.

2.2. Polygon (usually triangle) are Polygon (usually triangle) are converted to pixels using vertex converted to pixels using vertex information by information by rasterizationrasterization and and interpolation.interpolation.

Page 16: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

16

3/6/2006 © Ariel Shamir 31

Why Triangles?•Most simple polygon, a planar polygon.•Simplifies hardware design and implementation.•Every polygon can be triangulated.•Higher degree surfaces can be approximated to any extent by triangles.•Bilinear interpolation gives reasonable results (color, position, normal).

••Most simple polygon, a planar polygon.Most simple polygon, a planar polygon.

••Simplifies hardware design and Simplifies hardware design and implementation.implementation.••Every polygon can be triangulated.Every polygon can be triangulated.

••Higher degree surfaces can be Higher degree surfaces can be approximated to any extent by triangles.approximated to any extent by triangles.

••Bilinear interpolation gives reasonable Bilinear interpolation gives reasonable results (color, position, normal).results (color, position, normal).

3/6/2006 © Ariel Shamir 32

Vertex InformationPosition in space (Depth)

Normal

Color/Shading

Texture map coordinate

Position in space (Depth) Position in space (Depth)

NormalNormal

Color/ShadingColor/Shading

Texture map coordinateTexture map coordinate

Page 17: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

17

3/6/2006 © Ariel Shamir 33

From Triangle to PixelsTriangles are planar, this means a simple bilinear interpolation can be used to interpolate the attributes from the vertices to any pixel inside.

Triangles are planar, this means a Triangles are planar, this means a simple bilinear interpolation can be simple bilinear interpolation can be used to interpolate the attributes used to interpolate the attributes from the vertices to any pixel inside.from the vertices to any pixel inside.

3/6/2006 © Ariel Shamir 34

Color Bilinear Smoothing

Page 18: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

18

3/6/2006 © Ariel Shamir 35

Normal Bilinear Smoothing

3/6/2006 © Ariel Shamir 36

Boundary Polygonal Meshes: PolyhedraWe are looking at the patches boundaries structure (polygons) and not the type of patches, which can be arbitrary (and may even be mixed).

The simplest polygonal patches possible are triangles (always linear & planar), and in graphics they are mostly used.

We are looking at the patches boundaries We are looking at the patches boundaries structure (polygons) and not the type of structure (polygons) and not the type of patches, which can be arbitrary (and may patches, which can be arbitrary (and may even be mixed). even be mixed).

The simplest polygonal patches possible The simplest polygonal patches possible are triangles (always linear & planar), and are triangles (always linear & planar), and in graphics they are mostly used.in graphics they are mostly used.

Page 19: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

19

3/6/2006 © Ariel Shamir 37

Meshes

3/6/2006 © Ariel Shamir 38

Entities

Page 20: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

20

3/6/2006 © Ariel Shamir 39

Entities & RelationsThe entities in a boundary mesh are faces, edges, vertices (in volumetric also elements).The relations between these entities are incidence & Adjacency:FF, FE, FVEF, EE, EVVF,VE,VV

The entities in a boundary mesh are faces, The entities in a boundary mesh are faces, edges, vertices (in volumetric also edges, vertices (in volumetric also elements).elements).

The relations between these entities are The relations between these entities are incidence & Adjacency:incidence & Adjacency:FF, FE, FVFF, FE, FV

EF, EE, EVEF, EE, EV

VF,VE,VVVF,VE,VVf1

f2e1

e2

e3 e4

e5

v1

v3 v4

v2

3/6/2006 © Ariel Shamir 40

Separation of Topology and GeometryThe relations between the all entities in the mesh are the topology (connectivity) of the mesh.The positions of the entities in space are the geometry of the mesh.A mesh is defined by its topology and geometry together, but they can be separated as different views of the object.

The relations between the all entities in The relations between the all entities in the mesh are the the mesh are the topologytopology (connectivity) of (connectivity) of the mesh.the mesh.

The positions of the entities in space are The positions of the entities in space are the the geometrygeometry of the mesh.of the mesh.

A mesh is defined by its topology and A mesh is defined by its topology and geometry together, but they can be geometry together, but they can be separated as different views of the object.separated as different views of the object.

Page 21: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

21

3/6/2006 © Ariel Shamir 41

Duality – Face Adjacency Graph

3/6/2006 © Ariel Shamir 42

Polygonal Mesh RepresentationThe description of all relations is the topology (connectivity) of the mesh.THE representation issue: which of those relations we store explicitly and which (and how) implicitly?Most used in graphics: triangle soups and indexed face set.In solid modeling: half-edge, winged-edge.

The description of all relations is the The description of all relations is the topology (connectivity) of the mesh.topology (connectivity) of the mesh.

THE representation issue: which of those THE representation issue: which of those relations we store explicitly and which relations we store explicitly and which (and how) implicitly?(and how) implicitly?

Most used in graphics: triangle soups and Most used in graphics: triangle soups and indexed face set.indexed face set.

In solid modeling: halfIn solid modeling: half--edge, wingededge, winged--edge.edge.

Page 22: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

22

3/6/2006 © Ariel Shamir 43

Triangle Soup(x00,y00,z00) (x01,y01,z01) (x02,y02,z02) (x10,y10,z10) (x11,y11,z11) (x12,y12,z12)

(xn0,yn0,zn0) (xn1,yn1,zn1) (xn2,yn2,zn2)

Do we have any relations?Is this an efficient representation?

(x(x0000,y,y0000,z,z0000) (x) (x0101,y,y0101,z,z0101) (x) (x0202,y,y0202,z,z0202) ) (x(x1010,y,y1010,z,z1010) (x) (x1111,y,y1111,z,z1111) (x) (x1212,y,y1212,z,z1212))

……

(x(xn0n0,y,yn0n0,z,zn0n0) (x) (xn1n1,y,yn1n1,z,zn1n1) (x) (xn2n2,y,yn2n2,z,zn2n2))

Do we have any relations?Do we have any relations?Is this an efficient representation?Is this an efficient representation?

3/6/2006 © Ariel Shamir 44

Index Face SetV0… Vn then F0 … Fm(x0,y0,z0)

(xn,yn,zn)

(i0,j0,k0)

(im,jm,km)

Maybe other information: N0…Nn

Which relation we have?

VV00…… VVnn then Fthen F00 …… FFmm(x(x00,y,y00,z,z00))

……

((xxnn,y,ynn,z,znn))

(i(i00,j,j00,k,k00))

……

((iimm,j,jmm,k,kmm))

Maybe other information: NMaybe other information: N00……NNnn

Which relation we have?Which relation we have? FF��������VV

Page 23: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

23

3/6/2006 © Ariel Shamir 45

Storing or Computing Relations?F���� F ? Triangle adjacency?

V���� F ?

V���� V?

Other?

Efficiency?

FF�������� F ?F ? Triangle adjacency?Triangle adjacency?

VV�������� FF ??

VV�������� V?V?

Other?Other?

Efficiency?Efficiency?

3/6/2006 © Ariel Shamir 46

Add V����F Relation ExplicitlyVk���� f1 ,f2,… ,fn

V���� V? • Easy for triangles (union of all v� fi )

F ���� F?• Easy for triangles (intersection of two sets

of faces of vi and vj when vi , vj� F)

VVkk�������� ff1 1 ,f,f22,,…… ,f,fnn

VV�������� V? V? •• Easy for triangles (union of all vEasy for triangles (union of all v�� ffii ))

F F �������� F?F?•• Easy for triangles (intersection of two sets Easy for triangles (intersection of two sets

of faces of vof faces of vi i and and vvjj when vwhen vi i ,, vvjj �� FF))

Page 24: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

24

3/6/2006 © Ariel Shamir 47

Winged Edge Rep. Properties• Holds full topologic information

(relations)

• Represents any polygonal mesh (not only triangles) which is manifold!

• Works also for polygons with holes

• Relatively storage efficient

•• Holds full topologic information Holds full topologic information (relations)(relations)

•• Represents any polygonal mesh (not Represents any polygonal mesh (not only triangles) which is manifold!only triangles) which is manifold!

•• Works also for polygons with holesWorks also for polygons with holes

•• Relatively storage efficientRelatively storage efficient

3/6/2006 © Ariel Shamir 48

Manifold Every point there is a small surrounding (����-environment) that is homoeomorphic to a disk.• Intuitively: anything that can be flattened

to a plane.

• Sharp edges and creases are fine.

• Not a manifold example:

Every point there is a small Every point there is a small surrounding (surrounding (��������--environment) that is environment) that is homoeomorphichomoeomorphic to a disk.to a disk.•• Intuitively: anything that can be flattened Intuitively: anything that can be flattened

to a plane.to a plane.

•• Sharp edges and creases are fine.Sharp edges and creases are fine.

•• Not a manifold example:Not a manifold example:

Page 25: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

25

3/6/2006 © Ariel Shamir 49

Right Right TraversalTraversal

Left Left TraversalTraversal

FaceFaceVertexVertex

cceeddbb2211YYXXaa

nextnextprevprevnextnextprevprevrightrightleftleftendendstartstartedgeedge

Winged Edge

3/6/2006 © Ariel Shamir 50

Winged Edge Example

EdgeName Start End Left Right Pred Succ Pred Succ

a A D 3 1 e f b cb A B 1 4 c a f dc B D 1 2 a b d ed B C 2 4 e c b fe C D 2 3 c d f af A C 4 3 d b a e

Vertices Faces Left Traverse Right Traverse

Face Name

Incident Edge

1 a2 c3 a4 b

Vertex Name

Incident Edge

A aB bC dD eA

B

C

D

a

bdc

f

e

12

3

4

Page 26: 3D Objects Representations · 1 3/6/2006 © Ariel Shamir 1 3D Objects Representations AA rr iieel SShhaammir 3/6/2006 © Ariel Shamir 2 Overview Introduction Simple geometry & representations

26

3/6/2006 © Ariel Shamir 51

Polyhedron EditingOnce a polyhedron model is available one might want to edit it by adding or deleting vertices, edges and faces to create a new polyhedron. These operations are called Euler Operators. However, it has been shown that in the process of editing a polyhedron with Euler operators, some intermediate results may not be valid representation at all

Once a polyhedron model is available one Once a polyhedron model is available one might want to edit it by adding or deleting might want to edit it by adding or deleting vertices, edges and faces to create a new vertices, edges and faces to create a new polyhedron. These operations are called polyhedron. These operations are called Euler Operators. However, it has been Euler Operators. However, it has been shown that in the process of editing a shown that in the process of editing a polyhedron with Euler operators, some polyhedron with Euler operators, some intermediate results may not be valid intermediate results may not be valid representation at allrepresentation at all

3/6/2006 © Ariel Shamir 52

Euler-Poincaré FormulaV - E + F - (L - F) - 2(S - G) = 0 • V: the number of vertices

• E: the number of edges

• F: the number of faces

• G: the number of holes that penetrate the solid, usually referred to as genus in topology

• S: the number of shells. A shell is an internal void of a solid.

• L: the number of loops, all outer and inner loops of faces are counted.

V V -- E + F E + F -- (L (L -- F) F) -- 2(S 2(S -- G) = 0 G) = 0 •• V: the number of vertices V: the number of vertices

•• E: the number of edges E: the number of edges

•• F: the number of faces F: the number of faces

•• G: the number of holes that penetrate the solid, usually G: the number of holes that penetrate the solid, usually referred to as genus in topology referred to as genus in topology

•• S: the number of shells. A shell is an internal void of a solid.S: the number of shells. A shell is an internal void of a solid.

•• L: the number of loops, all outer and inner loops of faces are L: the number of loops, all outer and inner loops of faces are counted. counted.