CSCI 420: Computer Graphics
Hao Li
http://cs420.hao-li.com
Fall 2014
4.1 Polygon Meshes and Implicit Surfaces
1
4.1 Polygon Meshes and Implicit Surfaces Hao Li - - PowerPoint PPT Presentation
Fall 2014 CSCI 420: Computer Graphics 4.1 Polygon Meshes and Implicit Surfaces Hao Li http://cs420.hao-li.com 1 Geometric Representations point based quad mesh triangle mesh implicit surfaces / particles volumetric tetrahedrons 2
CSCI 420: Computer Graphics
http://cs420.hao-li.com
Fall 2014
1
2
implicit surfaces / particles volumetric tetrahedrons point based quad mesh triangle mesh
but how about an equation for a telephone, or a face?
simple pieces
3
Source: Wikipedia
4
No single technique solves all problems!
5
– if you use enough of them…
pentagons, … n-gons
what to do when polygon nonplanar, or concave,
6
edges vertices faces
7
glNormal3fv(n); glBegin(GL_POLYGONS);
glEnd();
glBegin(GL_POLYGONS); ¡ glNormal3fv(normal1); ¡ glVertex3fv(vert1); ¡ glNormal3fv(normal2); ¡ glVertex3fv(vert2); ¡ glNormal3fv(normal3); ¡ glVertex3fv(vert3); glEnd();
(think of a cube)
8
9
10
11
(since they encode connectivity)
12
Triangles x x x x x x ... ... ... x x x
9*4 = 36 B/f (single precision) 72 B/v (Euler Poincaré)
13
Vertices x ... x Triangles i ... ... ... ... i
12 B/v + 12 B/f = 36B/v
14
64 B/v
handling for arbitrary polygons
15
16
120 B/v
special case handling for neighbors
17
96 to 144 B/v
runtime overhead due to arbitrary faces
info only
(connectivity, adjacency) info only Fine for many purposes, but finding the faces adjacent to a vertex takes O(F) time for a model with F faces. Such queries are important for topological editing.
(pointers to adjacent vertices, edges, and faces).
18
# OBJ file for a 2x2x2 cube v -1.0 1.0 1.0 - Vertex 1 v -1.0 -1.0 1.0 - Vertex 2 v 1.0 -1.0 1.0 - Vertex 3 v 1.0 1.0 1.0 - … v -1.0 1.0 -1.0 v -1.0 -1.0 -1.0 v 1.0 -1.0 -1.0 v 1.0 1.0 -1.0 f 1 2 3 4 f 8 7 6 5 f 4 3 7 8 f 5 1 4 8 f 5 6 2 1 f 2 6 7 3
19
Syntax: v x y z
f v1 v2 … vn
vertices v1 v2 … vn #anything
20
count without
21
22
23
24
Bezier patch
25
Utah teapot
26
r
27
28
29
3 6 12 24
25% 6.5% 1.7% 0.4%
30
31
32
33
34
¡ Parametric Surfaces
35
36
37
Parametric Implicit
F < 0 F > 0
F = 0
¡ ¡ Implicit Surfaces
38
do not have this information
sphere with radius r :
¡ Quadric Surfaces
39
elipsoid parabolic hyperbolboids cone cylinder
40
F < 0? F = 0? F > 0?
Ray - Surface Intersection Test Inside/Outside Test
(depending on whom you ask):
¡
called Blobs, Metaballs, or Soft Objects. Great for modeling ¡
¡
animals.
41
42
43
glue pieces together
44
45
union difference intersection the merger of two objects into
the subtraction
from another the portion common to both objects
glue pieces together
that way (human-made, particularly machined objects)
46
47
¡ ¡ Negative Objects
48
Subtract From To get Inside(BLOCK-CYL) = Inside(BLOCK) And Not(Inside(CYL))
49
Inside(A) || Inside(B) Join A and B
Chop off any part of A that sticks out of B
Use B to Cut A
Examples:
¡
¡
¡ Implicit Functions for Booleans
replaces And (intersection)
replaces OR (union)
replaces NOT(unary subtraction)
50
F1 < 0 F2 < 0 F2 < 0 F1 < 0
51
Source: Wikipedia
¡ Implicit Surfaces
52
53
http://cs420.hao-li.com
54