introduction to visualization and computer graphics · introduction to visualization and computer...
TRANSCRIPT
![Page 1: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/1.jpg)
Introduction to Visualization and Computer Graphics
DH2320, Fall 2015
Prof. Dr. Tino Weinkauf
Introduction to Visualization and
Computer Graphics
Grids and Interpolation
![Page 2: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/2.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Next Tuesday
● No lecture next Tuesday!
![Page 3: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/3.jpg)
Introduction to Visualization and Computer Graphics
DH2320, Fall 2015
Prof. Dr. Tino Weinkauf
Grids and Interpolation
Structured Grids
Unstructured Grids
![Page 4: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/4.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Digital Data
![Page 5: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/5.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Scientific Data
![Page 6: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/6.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Data Representation
spatial domain
independent variables
data values
X
dependent variables
RmRn
![Page 7: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/7.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Data Representation
● In most cases, the visualization data represent a
continuous real object, e.g., an oscillating membrane, a
velocity field around a body, an organ, human tissue, etc.
● This object lives in an n-dimensional space - the domain
● Usually, the data is only given at a finite set of locations, or
samples, in space and/or time
● Remember imaging processes like numerical simulation and CT-
scanning, note similarity to pixel images
● We call this a discrete structure, or a discrete
representation of a continuous object
![Page 8: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/8.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Data Representation
● Discrete representations
● We usually deal with the reconstruction of a continuous real object
from a given discrete representation
● Discrete structures consist of point samples
● Often, we build grids/meshes that connect neighboring
samples
![Page 9: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/9.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Data Representation
● Discrete representations
● We usually deal with the reconstruction of a continuous real object
from a given discrete representation
● Discrete structures consist of point samples
● Often, we build grids/meshes that connect neighboring
samples
?
![Page 10: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/10.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Data Representation
● Grid terminology
0D: grid vertex
(grid point)
1D: grid line
2D: grid face
grid cell: largest-dimensional
element in a grid
2D: grid face
3D: grid voxel
3D: grid voxel
grid vertices
grid lines
grid faces
![Page 11: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/11.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Data Connectivity
● There are different types of grids:
● Structured grids
connectivity is implicitly given.
● Block-structured grids
combination of several structured grids
● Unstructured grids
connectivity is explicitly given.
● Hybrid grids
combination of different grid types
![Page 12: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/12.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids
Structured grids
● “Structured” refers to the implicitly given connectivity
between the grid vertices
● We distinguish different types of structured grids regarding
the implicitly or explicitly given coordinate positions of the
grid vertices
uniform grid implicitly given coordinates
rectilinear grid semi-implicitly given coordinates
curvilinear grid explicitly given coordinates
![Page 13: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/13.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Structured grids
● Number of grid vertices: 𝐷𝑥 , 𝐷𝑦 , 𝐷𝑧
● We can address every grid vertex with an index tuple (i, j, k)
● 0 ≤ 𝑖 < 𝐷𝑥 0 ≤ 𝑗 < 𝐷𝑦 0 ≤ 𝑘 < 𝐷𝑧
uniform grid implicitly given coordinates
rectilinear grid semi-implicitly given coordinates
curvilinear grid explicitly given coordinates
𝐷𝑥
𝐷𝑦
𝐷𝑥
𝐷𝑦
𝐷𝑥
𝐷𝑦
𝑖, 𝑗 = 2,3 𝑖, 𝑗 = 2,3 𝑖, 𝑗 = 2,3
![Page 14: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/14.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Structured grids
● Number of grid vertices: 𝐷𝑥 , 𝐷𝑦 , 𝐷𝑧
● We can address every grid cell with an index tuple (i, j, k)
● 0 ≤ 𝑖 < 𝐷𝑥 − 1 0 ≤ 𝑗 < 𝐷𝑦 − 1 0 ≤ 𝑘 < 𝐷𝑧 − 1
● Number of cells: 𝐷𝑥 − 1 × 𝐷𝑦 − 1 × (𝐷𝑧 − 1)
uniform grid implicitly given coordinates
rectilinear grid semi-implicitly given coordinates
curvilinear grid explicitly given coordinates
𝐷𝑥
𝐷𝑦
𝐷𝑥
𝐷𝑦
𝐷𝑥
𝐷𝑦
![Page 15: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/15.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Regular or uniform grids
● Cells are rectangles or rectangular cuboids of the same
size
● All grid lines are parallel to the axes
● To define a uniform grid, we need the following:
● Bounding box: (xmin, ymin, zmin) - (xmax, ymax, zmax)
● Number of grid vertices in each dimension: Dx, Dy, Dz
● Cell size: dx, dy, dz
very important
![Page 16: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/16.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Regular or uniform grids
● Well suited for image data (medical applications)
● Coordinate cell is very simple and cheap
● Global search is good enough; local search not required
● Coordinate of a grid vertex:
![Page 17: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/17.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Cartesian grid
● Special case of a uniform grid: 𝑑𝑥 = 𝑑𝑦 = 𝑑𝑧
● Consists of squares (2D), cubes (3D)
![Page 18: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/18.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Rectilinear grids
● Cells are rectangles of different sizes
● All grid lines are parallel to the axes
● Vertex locations are inferred from positions of grid lines for
each dimension:
● XLoc = {0.0, 1.5, 2.0, 5.0, …}
● YLoc = {-1.0, 0.3, 1.0, 2.0, …}
● ZLoc = {3.0, 3.5, 3.6, 4.1, …}
● Coordinate cell still quite simple
![Page 19: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/19.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Curvilinear grids
● Vertex locations are explicitly given
● XYZLoc = {(0.0, -1.0, 3.0), (1.5, 0.3, 3.5), (2.0, 1.0, 3.6), …}
● Cells are quadrilaterals or cuboids
● Grid lines are not (necessarily) parallel to the axes
2D curvilinear grid 3D curvilinear grids
![Page 20: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/20.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Curvilinear grids
● Coordinate cell:
● Local search within last cell or its immediate neighbors
● Global search via quadtree/octree
2D curvilinear grid
3D curvilinear grids
![Page 21: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/21.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Block-structured grids
● combination of several structured grids
DFG-funded SFB 557
Erik Wassen, TU Berlin, Germany 2008
![Page 22: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/22.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Visualization Scenarios
● Demands on data storage, an example:
Ahmed body
Block-structured grid with 52 blocks
Each block is a curvilinear grid
17 million grid cells in total
Temporal resolution: a particle
needs 10000 time steps from front
to back of the Ahmed body DFG-funded SFB 557
Erik Wassen, TU Berlin, Germany 2008
![Page 23: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/23.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Visualization Scenarios
● Demands on data storage, an example:
17 million grid cells
x 10000 time steps
x 7 variables
X 8 bytes per double
= 8.66 terra bytes
(60.62 TB for total
70000 time steps)
Do not save every time step, not every variable, and not every block.
DFG-funded SFB 557
Erik Wassen, TU Berlin, Germany 2008
![Page 24: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/24.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Unstructured grids
2D unstructured grid
consisting of triangles
3D unstructured grid
consisting of tetrahedra
(from TetGen user manual)
![Page 25: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/25.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Unstructured grids
● Vertex locations and connectivity
explicitly given
● Linear interpolation within a
triangle/tetrahedron using
barycentric coordinates
● Coordinate triangle/tetra:
● Local search within last
triangle/tetra or its immediate
neighbors
● Global search via
quadtree/octree
3D unstructured grid
consisting of tetrahedra
(from TetGen user manual)
![Page 26: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/26.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
How to store unstructured grids? Different requirements:
● Efficient storage
● bytes per face / bytes per vertex
● Efficient access
● of face / vertex properties (e.g., position)
● Efficient traversal
● e.g., neighboring face, 1-ring of a vertex,...
● Requirements are competing
![Page 27: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/27.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Face set
● Store faces
● 3 positions
● no connectivity
(“match positions”)
● Example: STL
● very simple structure
(too simple, unpractical!)
● easily portable
![Page 28: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/28.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Shared vertex
● vertex table stores
positions
● triangle table stores
indices into vertices
● No explicit connectivity
● Examples: OFF, OBJ, PLY
● Quite simple and efficient
● Enables efficient operations
on static meshes
![Page 29: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/29.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Face-based connectivity
● vertices store
● position
● face reference
● faces store
● 3 vertex references
● references to 3
neighboring faces
![Page 30: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/30.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Edge-based connectivity
● vertex stores
● position
● reference to 1 edge
● edge stores references to
● 2 vertices
● 2 faces
● 4 edges
● face stores
● reference to 1 edge
![Page 31: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/31.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Halfedge based connectivity
Half-edge based connectivity
● vertex stores
● position
● reference to 1 half-edge
● half-edge stored references to
● 1 vertex
● 1 face
● 1, 2, or 3 half-edges
● face stores
● reference to 1 half-edge
![Page 32: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/32.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Half-edge based connectivity
![Page 33: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/33.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
Half-edge based connectivity: Traversal
● Building blocks
● Vertex to (outgoing) halfedge
● half-edge to next (previous) halfedge
● half-edge to neighboring half-edge
● half-edge to face
● half-edge to start (end) vertex
● Example: Traverse around vertex (1-ring)
● enumerate vertices/faces/half-edges
![Page 34: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/34.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
![Page 35: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/35.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
● Outgoing halfedge
![Page 36: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/36.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
● Outgoing halfedge
● Opposite halfedge
![Page 37: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/37.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
● Outgoing halfedge
● Opposite halfedge
● Next half-egde
![Page 38: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/38.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
● Outgoing halfedge
● Opposite halfedge
● Next half-egde
● Opposite ...
![Page 39: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/39.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
1-ring traversal
● Start at vertex
● Outgoing halfedge
● Opposite halfedge
● Next half-egde
● Opposite ...
● Next ...
● ...
![Page 40: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/40.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Half-edge based libraries
● CGAL
● www.cgal.org
● Computational geometry
● Free for non-commercial use
● Open Mesh
● www.openmesh.org
● Mesh processing
● Free, LGPL license
● gmu (gmu-lite)
● proprietary, directed edges
![Page 41: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/41.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Unstructured grids
2D unstructured grid
consisting of quads
Source: https://www.sharcnet.ca/Software/Gambit/html/modeling_guide/mg0303.htm
![Page 42: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/42.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Hybrid grids
● combination of different grid types
2D hybrid grid
![Page 43: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/43.jpg)
Introduction to Visualization and Computer Graphics
DH2320, Fall 2015
Prof. Dr. Tino Weinkauf
Grids and Interpolation
Linear, Bilinear, Trilinear Interpolation in Structured Grids
Gradients
Linear Interpolation in Unstructured Grids
![Page 44: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/44.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● A grid consists of a finite number of samples
● The continuous signal is known only at a few points (data points)
● In general, data is needed in between these points
● By interpolation we obtain a representation that matches
the function at the data points
● Reconstruction at any other point possible
?
![Page 45: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/45.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Simplest approach: Nearest-Neighbor Interpolation
● Assign the value of the nearest grid point to the sample.
![Page 46: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/46.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Linear Interpolation (in 1D domain)
● Domain points , scalar function
General:
Special Case:
Basis Coefficients
![Page 47: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/47.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Linear Interpolation (in 1D domain)
● Sample values
● Continuity (discontinuous first derivative)
● Use higher order interpolation for smoother transition, e.g.,
cubic interpolation
![Page 48: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/48.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Interpolation in 2D, 3D, 4D, …
● Tensor Product Interpolation
● Perform linear / cubic … interpolation in each x,y,z … direction
separately
Bi-Linear Bi-Cubic
![Page 49: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/49.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Bilinear Interpolation
2D, “bi-linear”
“interpolate twice in x direction
and then once in y direction”
very important
![Page 50: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/50.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Grids and Interpolation
● Example: Bi-linear interpolation in a 2D cell
● Repeated linear interpolation
![Page 51: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/51.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation
● Trilinear Interpolation
3D, “tri-linear”
“interpolate four times in x
direction, twice in y direction, and
once in z direction”
![Page 52: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/52.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Function Derivatives
● Function Derivative Estimation
● Called Gradients for multidimensional functions
● Have a lot of important applications (e.g., normal for volume
rendering, critical point classification for vector field topology …)
● Describes direction of steepest ascend
“vector of partial
derivatives“
![Page 53: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/53.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Function Derivatives
● Two ways to estimate gradients:
● Direct derivation of interpolation formula
● Finite differences schemes
![Page 54: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/54.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Field Function Derivatives
● Field Function Derivatives, Bi-Linear
“constant in x
direction“
“constant in y
direction“
derive this
interpolation formula
![Page 55: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/55.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Field Function Derivatives
● Problem of exact linear function differentiation:
discontinuous gradients
● Solution:
● Use higher order interpolation scheme (cubic)
● Use finite difference estimation
(Piecewise) linear function Gradient
![Page 56: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/56.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Finite Differences
● Finite Differences Schemes
● Apply Taylor series expansion around samples
Linear
function
Continuous
function
Forward
difference
Backward
difference
Taylor expansion
![Page 57: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/57.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Finite Differences
● Finite Differences Schemes
● Central differences have higher approximation order than
forward / backward differences
Difference
Central
difference
![Page 58: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/58.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Finite Differences
● Finite Differences Schemes, Higher order derivatives
● 1D Example, linear interpolation
(Piecewise) linear function Central
differences
![Page 59: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/59.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation in Triangles
● Piecewise Linear Interpolation in Triangle Meshes
![Page 60: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/60.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Interpolation in Triangles
● Linear Interpolation in a Triangle
● There is exactly one linear function that
satisfies the interpolation constraint
● A linear function can be written as
● Polynomial can be obtained by
solving the linear system
● Linear in and
● Interpolated values along any ray in the plane spanned by the
triangle are linear along that ray
![Page 61: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/61.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Coordinates
● Barycentric Coordinates:
● Planar case:
Barycentric combinations of 3 points
● Area formulation:
1:with,321 pppp
1
)),,((
)),,((,
)),,((
)),,((,
)),,((
)),,((
321
21
321
31
321
32
ppp
ppp
ppp
ppp
ppp
ppp
area
area
area
area
area
area
p1
p2
p3
p
![Page 62: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/62.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Coordinates
● Barycentric Coordinates:
● Linear formulation:
p1
p2
p3
p
32313
33321
321
321
)1(
ppppp
ppppp
ppp
pppp
p1
p2
p3
p
![Page 63: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/63.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Coordinates
p1
p2
p3
p
p1
p2
p3
p
1:with,321 pppp
![Page 64: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/64.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Interpolation
● Barycentric Interpolation in a Triangle
● The linear function of a triangle can be computed at any point as
with (Barycentric Coordinates)
● This also holds for the coordinate of the triangle:
→ Can be used to solve for unknown coefficients :
very important
![Page 65: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/65.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Interpolation
● Barycentric Interpolation in a Triangle
● Solution of (e.g. Cramer's rule):
with
Inside triangle criteria
![Page 66: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/66.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Interpolation
● Barycentric Interpolation in a Tetrahedron
● Analogous to the triangle case
![Page 67: Introduction to Visualization and Computer Graphics · Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015 Data Representation In most cases,](https://reader035.vdocuments.net/reader035/viewer/2022081421/5f02e3597e708231d40681f1/html5/thumbnails/67.jpg)
Introduction to Visualization and Computer Graphics, Tino Weinkauf, KTH Stockholm, Fall 2015
Barycentric Interpolation
Gradient of a linearly interpolated function in a
triangle/tetrahedron
● Constant!