Geometric Representations 3D Graphics Motivation Geometric - - PowerPoint PPT Presentation

geometric representations
SMART_READER_LITE
LIVE PREVIEW

Geometric Representations 3D Graphics Motivation Geometric - - PowerPoint PPT Presentation

Geometric Representations 3D Graphics Motivation Geometric representation What do we want to do? empty space (typically 3 ) B geometric object B 3 Fundamental problem The Problem: d B infinite number of


slide-1
SLIDE 1

Geometric Representations

3D Graphics

slide-2
SLIDE 2

Motivation

slide-3
SLIDE 3

Geometric representation

  • What do we want to do?

empty space (typically ℝ3) geometric object B ℝ3 B ℝ𝑒

slide-4
SLIDE 4

Fundamental problem

  • The Problem:

We need to encode a continuous model with a finite amount of information

B ℝd infinite number of points my computer: 8GB of memory

slide-5
SLIDE 5

Where does this problem occur?

  • Reconstruction from real data
  • Modeling or analyses based on acquired

scenes

  • Procedural modeling
  • Automatic modeling of structured

scenes or objects

  • Interactive modeling
  • Develop tools for computer artists
slide-6
SLIDE 6

Overview

Volume Representation Surface Representation Implicit

  • Voxel grid
  • Level sets

Parametric

  • Tetrahedral meshes
  • Spline surfaces
  • Subdivision surfaces
  • Primitive meshes
  • Triangle meshes
slide-7
SLIDE 7

Volume representations

slide-8
SLIDE 8

Volume

Definition: compact subset of ℝ3

slide-9
SLIDE 9

Interest of volumetric representation

  • Allows to model interior

information of shapes, e.g. shape densities, colors etc.

  • For modeling and

simulation, can constrain unrealistic shape variation

  • Many of the models used

in graphics (animals, plants) are volumetric in reality

slide-10
SLIDE 10

Implicit voxel grid

  • Defined by function

𝐺: ℝ3 → ℝ

  • Discretized voxel grid

assigns a value 𝑤 to position (𝑦, 𝑧, 𝑨)

slide-11
SLIDE 11

Implicit voxel grid

Advantages

  • Straight forward to

extract or change value 𝑤 associated to position (𝑦, 𝑧, 𝑨) Disadvantages

  • Difficult to modify

shape as no high-level information is available

  • For irregular shapes,

requires voxelization of large volume

slide-12
SLIDE 12

Parametric tetrahedral mesh

Defined by a function

𝑔: Ω → ℒ with Ω ⊂ ℝ3 ℒ ⊂ ℝ3 = volume of interest

slide-13
SLIDE 13

Parametric tetrahedral mesh

Advantages

  • Allows to modify the

shape by changing the mapping function

  • Used for deformations

and simulations Disadvantages

  • Difficult to store

associated information 𝑤 associated to position (𝑦, 𝑧, 𝑨) at non-vertex positions

  • Interpolating values

requires computation

slide-14
SLIDE 14

Surface representations

slide-15
SLIDE 15

Surface

Definition: orientable 2D manifold embedded in ℝ3 Intuitively:

  • Boundary surface of non-

degenerate 3D solid

  • Non-degenerate: no

infinitely thin parts, i.e. solid has a clearly defined interior and exterior

slide-16
SLIDE 16

Implicit Level Sets

  • Defined by function

𝐺: ℝ3 → ℝ

  • Discretized voxel grid

assigns a distance 𝑒 from the surface to each position (𝑦, 𝑧, 𝑨)

slide-17
SLIDE 17

Implicit Level Sets

Advantages

  • Straight forward to

extract or change value 𝑤 associated to position (𝑦, 𝑧, 𝑨)

  • Allows for fast Boolean
  • perations of surfaces

Disadvantages

  • Difficult to modify

surface as no high-level information is available

  • For irregular shapes,

requires voxelization of large volume

slide-18
SLIDE 18

Parametric Surface Representations

Defined by a function

𝑔: Ω → ℒ with Ω ⊂ ℝ2 ℒ ⊂ ℝ3 = full embedding space

slide-19
SLIDE 19

Spline surfaces

  • Parameter domain Ω = 𝑣𝑜, 𝑣𝑛 × 𝑤𝑜, 𝑤𝑙
  • Polynomial or rational basis functions 𝑂𝑗

𝑜(. )

  • 𝑣, 𝑤 → σ𝑗=0

𝑛 σ𝑘=0 𝑙

𝑑 𝑗𝑘 𝑂𝑗

𝑜 𝑣 𝑂 𝑘 𝑜 𝑤

  • 𝑑 𝑗𝑘 are called control points and define a control

mesh

Historic example « Utah teapot »

slide-20
SLIDE 20

Spline Surfaces

Advantages

  • Allows to model

smooth surfaces

  • Easy to evaluate points

at any position

  • Allows for deformation

by changing control points Disadvantages

  • Difficult to fit to

acquired scan data efficiently

slide-21
SLIDE 21

21

Loop Butterfly Catmull-Clark

Subdivision surfaces

  • Topology defined by the control polygon
  • Progressive refinement (interpolation or approximation)
slide-22
SLIDE 22

Subdivision surfaces

  • Like splines, they are hence controlled by coarse

control mesh

  • Each step involves
  • Subdivision (insertion of new vertices)
  • Adjustment of vertex positions (new only for

interpolation schemes, all for approximation schemes)

  • Provably converge to smooth limit surfaces
slide-23
SLIDE 23

Subdivision Surfaces

Advantages

  • Arbitrary geometry and

topology can be modeled

  • Approximation at

different level of detail Disadvantages

  • No parameterization
  • Some unexpected

results

Loop

slide-24
SLIDE 24

Primitive meshes

  • Primitive Meshes
  • Collection of geometric primitives
  • Triangles
  • Quadrilaterals
  • Typically, primitives are

parametric surfaces

  • Composite model:
  • Mesh encodes topology, rough shape
  • Primitive parameter encodes local geometry
  • Triangle meshes rule the world (including “triangle

soups”)

slide-25
SLIDE 25

Primitive meshes

  • Complex Topology for Parametric Models
  • Mesh of parameter domains attached in a mesh
  • Domain can have complex shape (“trimmed patches”)
  • Separate mapping function f for each part

(typically of the same class)

1 2 3

slide-26
SLIDE 26

Primitive meshes

Advantages

  • Compact representation

(usually)

  • Can represent arbitrary

topology Disadvantages

  • Need to specify a mesh

first, then edit geometry

  • Problems
  • Mesh structure needs to

be adjusted to fit shape

  • Mesh encodes object

topology  Changing object topology is difficult

  • Examples
  • Surface reconstruction
  • Fluid simulation (surface
  • f splashing water)
slide-27
SLIDE 27

Special case: Triangle mesh

slide-28
SLIDE 28

Triangle meshes

  • (Probably) most common representation
  • Simplest surface primitive

that can be assembled into meshes

  • Rendering in hardware (z-buffering)
  • Simple algorithms for intersections (raytracing,

collisions)

  • Piecewise linear surface representation
  • Each triangle (𝒃, 𝒄, 𝒅) defines points

𝒒 = α𝒃 + β𝒄 + γ𝒅 with α + β + γ = 1, α + β + γ > 0

slide-29
SLIDE 29

Attributes

  • How to define a triangle?
  • We need three points in ℝ3 (obviously).
  • But we can have more:

per-vertex normals

(represent smooth surfaces more accurately)

per-vertex color texture per-vertex texture coordinates (etc...)

slide-30
SLIDE 30

Shared Attributes in Meshes

In Triangle Meshes:

  • Attributes might be shared or separated:

adjacent triangles share normals adjacent triangles have separated normals

slide-31
SLIDE 31

“Triangle Soup”

  • Variants in triangle mesh representations:
  • “Triangle Soup”
  • A set S = {t1, ..., tn} of triangles
  • No further conditions
  • Does not represent a surface
  • Triangle Meshes: Additional consistency conditions
  • Conforming meshes: Vertices meet only at vertices
  • Manifold meshes: No intersections, no T-junctions
slide-32
SLIDE 32

Conforming Meshes

  • Conforming Triangulation:
  • Vertices of triangles must only meet at vertices, not in

the middle of edges:

  • This makes sure that we can move vertices around

arbitrarily without creating holes in the surface

slide-33
SLIDE 33

Manifold Meshes

Triangulated two-manifold:

  • Every edge is incident to exactly 2 triangles

(closed manifold)

  • ...or to at most two triangles (manifold with boundary)
  • No triangles intersect (other than along common edges
  • r vertices)
  • Two triangles that share a vertex must share an edge
slide-34
SLIDE 34

Attributes

  • In general:
  • Vertex attributes:
  • Position (mandatory)
  • Normals
  • Color
  • Texture Coordinates
  • Face attributes:
  • Color
  • Texture
  • Edge attributes (rarely used)
  • E.g.: Visible line
slide-35
SLIDE 35

In-class exercise

slide-36
SLIDE 36

In-class exercise

  • How would you describe a triangle mesh whose

attributes are only vertex positions?

  • What data structure would you use?
  • What are the advantages and disadvantages?
slide-37
SLIDE 37

Some common data structures

  • List of vertices, triangles, edges
  • Half-edge data structure
slide-38
SLIDE 38

Simple data structure

  • The simple approach: List of vertices, edges,

triangles

v1: (posx posy posz), attrib1, ..., attribnav ... vnv: (posx posy posz), attrib1, ..., attribnav e1: (index1 index2), attrib1, ..., attribnae ... ene: (index1 index2), attrib1, ..., attribnae t1: (idx1 idx2 idx3), attrib1, ..., attribnat ... tnt: (idx1 idx2 idx3), attrib1, ..., attribnat

slide-39
SLIDE 39

Pros & Cons

Advantages:

  • Simple to understand and

build

  • Provides exactly the

information necessary for rendering Disadvantages:

  • Dynamic operations are

expensive:

  • Removing or inserting a

vertex  renumber expected edges, triangles

  • Adjacency information is
  • ne-way
  • Vertices adjacent to

triangles, edges  direct access

  • Any other relationship 

need to search

  • Can be improved using hash

tables (but still not dynamic)

slide-40
SLIDE 40

Adjacency data structures

Alternative:

  • Some algorithms require extensive neighborhood
  • perations (get adjacent triangles, edges, vertices)
  • ...as well as dynamic operations (inserting, deleting

triangles, edges, vertices)

  • For such algorithms, an adjacency based data structure

is usually more efficient

  • The data structure encodes the graph of mesh elements
  • Using pointers to neighboring elements
slide-41
SLIDE 41

First try...

  • Straightforward Implementation:
  • Use a list of vertices, edges,

triangles

  • Add a pointer from each element

to each of its neighbors

  • Global triangle list can be used for rendering
  • Remaining Problems:
  • Lots of redundant information – hard to keep consistent
  • Adjacency lists might become very long
  • Need to search again (might become expensive)
  • This is mostly a “theoretical problem” (O(n) search)
slide-42
SLIDE 42

Less Redundant Data Structures

Half edge data structure:

  • Half edges, connected by clockwise / ccw pointers
  • Pointers to opposite half edge
  • Pointers to/from start vertex of each edge
  • Pointers to/from left face of each edge
slide-43
SLIDE 43

// a vertex struct Vertex { HalfEdge* someEdge; /* vertex attributes */ }; // the face (triangle, poly) struct Face { HalfEdge* half; /* face attributes */ };

Implementation

  • // a half edge
  • struct HalfEdge {
  • HalfEdge* next;
  • HalfEdge* previous;
  • HalfEdge* opposite;
  • Vertex* origin;
  • Face* leftFace;
  • EdgeData* edge;
  • };
  • // the data of the edge
  • // stored only once
  • struct EdgeData {
  • HalfEdge* anEdge;
  • /* attributes */
  • };
slide-44
SLIDE 44

Implementation

Implementation:

  • The data structure should be encapsulated
  • To make sure that updates are consistent
  • Implement abstract data type with more high level operations

that guarantee consistency of back and forth pointers

  • Free Implementations are available, for example
  • OpenMesh
  • CGAL
  • Many alternative data structures exist: for example

winged edge (Baumgart 1975)

slide-45
SLIDE 45

Hierarchical modeling

slide-46
SLIDE 46

Hierarchical modeling

  • Basic example: OpenGL programming
  • Describe each object in the frame where it is the

simplest

  • Assemble them in a hierarchy for consistency!
slide-47
SLIDE 47

Example of hierarchical modeling

  • Character = hierarchy of limbs
  • The foot remains connected to the leg when the

hip articulates !