· Types Boundary Representation (B-Rep) Primitives Sweeps Voxel Octree CSG … Visible Human ˘...
Transcript of · Types Boundary Representation (B-Rep) Primitives Sweeps Voxel Octree CSG … Visible Human ˘...
1
����������� ����
���������
Lecture 3: Modeling (2): Solids
Bernhard JungTU-BAF, Summer 2006
��������
� Solids� Motivation� B-Reps� Sweeps� Voxels & Octtrees� Constructive Solid Geometry
� Advanced Methods� Blobby Objects� Fractals� …
Further readingA. Watt. 3D Computer Graphics. 3rd edition Addison-Wesley. 2000. Chapter 2.Foley, van Dam, Feiner, Hughes, Phillips. Introduction to Computer Graphics. Addison-Wesley.
1997. Chapter 10.
2
�����
� Idea: Represent solid interiors of objects� surface may not be described explicitly
� Types� Boundary Representation (B-Rep)� Primitives� Sweeps� Voxel� Octree� CSG� …
Visible Human
�����
��������
� Some acquisition methods generate solids� example: CAT (or CT) scan
"Computed Axial Tomography" is the process of using computers to
generate a three-dimensional image from flat (i.e, two-dimensional) x-ray
pictures, one slice at a time
3
�����
��������
� Some applications require solids� example: CAD / CAM
������� ����������������������
������������������ ����!�"#$%&� domain
� it should be possible to represent a large number of shapes� unambiguous
� a representation should correspond to only one solid� unique
� can encode any given solid in only one way� accurate
� allows an object to be represented without approximation� impossibility of creating invalid representations� easy to create valid representations� closure under rotation, translation etc
� performing these operations on valid solids yields valid solids� compact
� save space, therefore efficient transmission over a network� support of efficient algorithms
� efficient rendering, calculation of physical properties
4
�����
' ����(���������������)'*���+
� Solid represented by its surface boundaries� not every set of surfaces represents a solid !
�����
' ����(���������������)'*���+
� Euler-Poincaré Formula (for objects with no holes)� v – e + f = 2
where v is number of vertices, e is number if edges, and f is number of faces
cube with 6 faces, 8 vertices, and 12 edges
cube with 7 faces, 8 vertices, and 13 edges
5
�����
' ����(���������������)'*���+
� Generalized Euler-Poincaré Formula (for objects with holes)� v – e + f = 2 ( 1 - g )
where v is number of vertices, e is number if edges, and f is number of faces, g is gender (� number of holes)
cube with 14 faces, 24 vertices, 40
edges, and gender 2
�����
�����������)����������,��������-+� 3D modeling systems typically
provide a set of primitive shapes� e.g. boxes, spheres, …� sometimes also more complex
objects� Primitives are parametric, to
instantiate user supplies dimensional parameters
� Advantages� easy to model� compact description � 3D viewer can decide rendering
detail
VRML: Box, Cone, Cylinder, Sphere
6
�����
������
� 2D cross section� translational sweep� rotational sweep
� common in CAD systems
VRML: Extrusion2D cross section
translationalsweep
rotational sweep
�����
������
� may sweep along curves
� … even helical ones
7
�����
�������� .��/�01�� ����
� define 2D cross section� extrude along spine
� defined by sequence of 3D points� linear interpolation in-between
� May define a scale factor for spine definition points
Extrusion {crossSection [1 1, 1 -1, -1 -1, -1 1, 1 1]spine [0 0 0, 0 2 0, 0 4 0]scale [1 1, 0.5 0.5, 1 1]}Extrusion {crossSection [1 1, 1 -1, -1 -1, -1 1, 1 1]spine [0 0 0, 0 2 0, 1 3 0, 2 3 0]scale [1 1, 1 0.5, 0.5 1, 0.5 0.5]}
�����
.1���
� Partition space into uniform grid� Grid cells are called a voxels (like pixels)
� Store properties of solid object with each voxel� Occupancy� Color� Density� Temperature� etc.
8
�����
.1���� ������
� Scanning devices� MRI (magnetic resonance imaging)
� does not involve X-rays� CAT / CT (Computed Axial Tomography)
� Simulation� FEM (Finite Element
Method)
�����
.1������-�
� O(n3) storage for n x n x n grid� 1 billion voxels for 1000 x 1000 x 1000
9
�����
.1��'��������������
� union, intersection, difference of two objects� compare objects voxel by voxel
� trivial
�����
.1���
� Advantages� Simple, intuitive, unambiguous� Same complexity for all objects� Natural acquisition for some applications� Trivial Boolean operations
� Disadvantages� Approximate� Not affine invariant
� affine transformations: translation, rotation, scaling, …not affine: perspective transformations
� Large storage requirements� Expensive display
10
�����
2 ������������������
� Refine resolution of voxels hierarchically� More concise and efficient
for non-uniform objects
Octree
�����
2 ������ '��������������
11
�����
���� �����������������(
� Represent solid object as hierarchy of booleanoperations� union� intersection� difference
� CSG Tree� leaves: primitive� interior nodes: boolean
operation or affine transformation
�����
���� �����������������(
� Drawbacks� Exhibits no explicit
geometric information. Requires expensive tree evaluations
� Imposes limitations on operations available to create and modify a solid
12
���������������-�3��������
Many high level modeling tools provide:� Skinning� Skin of Virtual Actors� Blobby Surfaces� Beveling, Rounding, Fillets
A procedural modeling technique:� Fractals
���������������-
�4�����-
• user defines segments of anarticulated body
• animation system stitchesthe segments together to create a flexible skin
13
���������������-
� ����������������������4��
• user defines body skeleton
• animation system wraps a flexible skin around the skeleton
skeletonautomatic skin
less detailmanual skinmore detail
���������������-
'���(�� �������)�4� ���������+
• User defines a set of metaballs
• Each metaball (blue) has its ownsphere of influence (light blue)
• Where these spheres of influencecross determines how the objectsfuse
metaballs blobbed togetherunblobbed metaballs
14
���������������-
'���(�� �������)�4� ���������+
from http://www.robinwood.com/Catalog/Technical/BryceTuts/BryceTutSet.html
���������������-
'���(�� �������)�4� ���������+
Modeling: Vikki Dawsonusing Bryce 5
from: http://www.3dtoday.com/3dtutorials/2003/May/B5Character/
15
���������������-
'���(�� �������)�4� ���������+
� defined via implicit functions: F(x,y,z) = 0� e.g. unit sphere:
F(x,y,z) = x2 + y2 + z2 – 1 = 0
� restricted to simple base shapes� e.g. spheres, ellipsoids, (quadrics)
� add, subtract, other forms of blending
� easy collision detection
� relatively hard to render (need to ray-trace or convert to polygon, both slow)
iso-line of equal temperaturearound two heat sources
���������������-
'���(�� �������)�4� ���������+
http://www.corelmag.com/1103/overview/Metaball_Modeling.html
16
���������������-
'������-!�� ����-!�5������
� Customize edges between adjacent surfaces
filletsbeveling & rounding
���������������-
5�������
� Useful for describing natural 3D phenomenon� Terrain� Plants� Clouds� Water� Feathers� Fur� etc.
� A kind of “procedural modeling”
17
���������������-
5�������
Fractal Generation� Deterministically self-similar fractals
� Parts are scaled copies of original
� Statistically self-similar fractals� Parts have same statistical properties as original
���������������-�� 5�������
��������������5����������������
� General procedure:� Initiator: start with a
shape� Generator: replace
subparts with scaled copy of original
� Apply generator repeatedly
18
���������������-�� 5�������
��������������5����������������
� Useful for creating interesting shapes
���������������-�� 5�������
��������������5����������������
� Useful for creating interesting shapes
19
���������������-�� 5�������
������������5����������������
� General procedure:� Initiator: start with a shape� Generator: replace subparts with a self-similar random
pattern
Random Midpoint Displacement
���������������-�� 5�������
������������5����������������
� Example: Terrain
20
���������������-�� 5�������
������������5����������������
� Useful for creating 3D plants
���������������-�� 5�������
������������5����������������
� Useful for creating 3D plants
21
������������������������������ Accuracy
� Polygonal b-reps and voxels / octtrees: can only approximate shapes (often good enough)
� better: CSG, b-rep with curved surfaces, primitives� Domain
� limited for primitive instancing, sweeps� voxels / octtrees and b-reps can represent a wide class of objects
� Uniqueness� only voxels / octrees guarantee uniqueness
(an object can only be represented in one way)� Validity
� b-reps are the most difficult to validate� Closure under boolean operations
� primitives cannot be combined at all; sweeps not closed under boolean operations� Efficient rendering
� easy for (polygonal) b-reps� harder for voxels / octrees
� Compactness� high memory requirements for voxels / octtrees; better: CSG