advanced computer graphics - tu freiberg · 1 advanced computer graphics lecture 3: modeling (2):...
TRANSCRIPT
1
Advanced Computer Graphics
Lecture 3: Modeling (2): Solids
Bernhard JungTU-BAF, Summer 2007
Overview
SolidsMotivationB-RepsSweepsVoxels & OcttreesConstructive Solid Geometry
Advanced MethodsBlobby ObjectsFractals…
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
Solids
Idea: Represent solid interiors of objects
surface may not be described explicitlyTypes
Boundary Representation (B-Rep)PrimitivesSweepsVoxelOctreeCSG…
Visible Human
SolidsMotivation
Some acquisition methods generate solidsexample: 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
SolidsMotivation
Some applications require solidsexample: CAD / CAM
Solids – Desirable Properties of Representations [Requicha, 1980]
domainit should be possible to represent a large number of shapes
unambiguousa representation should correspond to only one solid
uniquecan encode any given solid in only one way
accurateallows an object to be represented without approximation
impossibility of creating invalid representationseasy to create valid representationsclosure under rotation, translation etc
performing these operations on valid solids yields valid solidscompact
save space, therefore efficient transmission over a networksupport of efficient algorithms
efficient rendering, calculation of physical properties
4
Solids
Boundary Representation (B-Rep)
Solid represented by its surface boundariesnot every set of surfaces represents a solid !
Solids
Boundary Representation (B-Rep)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
Solids
Boundary Representation (B-Rep)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
SolidsPrimitives (Primitive Instancing)
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 parametersAdvantages
easy to modelcompact description 3D viewer can decide rendering detail
VRML: Box, Cone, Cylinder, Sphere
6
SolidsSweeps
2D cross sectiontranslational sweeprotational sweep
common in CAD systems
VRML: Extrusion2D cross section
translationalsweep
rotational sweep
SolidsSweeps
may sweep along curves
… even helical ones
7
Solids
Sweeps – VRML Extrusionsdefine 2D cross sectionextrude along spine
defined by sequence of 3D pointslinear 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]}
SolidsVoxels
Partition space into uniform gridGrid cells are called a voxels (like pixels)
Store properties of solid object with each voxelOccupancyColorDensityTemperatureetc.
8
SolidsVoxel Acquisition
Scanning devicesMRI (magnetic resonance imaging)
does not involve X-raysCAT / CT (Computed Axial Tomography)
SimulationFEM (Finite Element Method)
SolidsVoxel Storage
O(n3) storage for n x n x n grid1 billion voxels for 1000 x 1000 x 1000
9
SolidsVoxel Boolean Operations
union, intersection, difference of two objectscompare objects voxel by voxel
trivial
SolidsVoxels
AdvantagesSimple, intuitive, unambiguousSame complexity for all objectsNatural acquisition for some applicationsTrivial Boolean operations
DisadvantagesApproximateNot affine invariant
affine transformations: translation, rotation, scaling, …not affine: perspective transformations
Large storage requirementsExpensive display
10
SolidsQuadtrees and Octrees
Refine resolution of voxels hierarchically
More concise and efficient for non-uniform objects
Octree
SolidsQuadtree Boolean Operations
11
SolidsConstructive Solid Geometry
Represent solid object as hierarchy of booleanoperations
unionintersectiondifference
CSG Treeleaves: primitiveinterior nodes: booleanoperation or affine transformation
SolidsConstructive Solid Geometry
DrawbacksExhibits no explicit geometric information. Requires expensive tree evaluations Imposes limitations on operations available to create and modify a solid
12
Advanced Modeling Utilities
Many high level modeling tools provide:SkinningSkin of Virtual ActorsBlobby SurfacesBeveling, Rounding, Fillets
A procedural modeling technique:Fractals
Advanced ModelingSkinning
• user defines segments of anarticulated body
• animation system stitchesthe segments together to create a flexible skin
13
Advanced Modeling
Automated Generation of a Skin
• user defines body skeleton
• animation system wraps a flexible skin around the skeleton
skeleton automatic skinless detail
manual skinmore detail
Advanced Modeling
Blobby Surfaces (aka Metaballs)
• 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
Advanced Modeling
Blobby Surfaces (aka Metaballs)
from http://www.robinwood.com/Catalog/Technical/BryceTuts/BryceTutSet.html
Advanced Modeling
Blobby Surfaces (aka Metaballs)
Modeling: Vikki Dawsonusing Bryce 5
from: http://www.3dtoday.com/3dtutorials/2003/May/B5Character/
15
Advanced ModelingBlobby Surfaces (aka Metaballs)
defined via implicit functions: F(x,y,z) = 0e.g. unit sphere: F(x,y,z) = x2 + y2 + z2 – 1 = 0
restricted to simple base shapese.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
Advanced Modeling
Blobby Surfaces (aka Metaballs)
http://www.corelmag.com/1103/overview/Metaball_Modeling.html
16
Advanced ModelingBeveling, Rounding, Fillets
Customize edges between adjacent surfaces
filletsbeveling & rounding
Advanced ModelingFractals
Useful for describing natural 3D phenomenonTerrainPlantsCloudsWaterFeathersFuretc.
A kind of “procedural modeling”
17
Advanced ModelingFractalsFractal Generation
Deterministically self-similar fractalsParts are scaled copies of original
Statistically self-similar fractalsParts have same statistical properties as original
Advanced Modeling – Fractals
Deterministic Fractal Generation
General procedure:Initiator: start with a shapeGenerator: replace subparts with scaled copy of original
Apply generator repeatedly
18
Advanced Modeling – Fractals
Deterministic Fractal Generation
Useful for creating interesting shapes
Advanced Modeling – Fractals
Deterministic Fractal Generation
Useful for creating interesting shapes
19
Advanced Modeling – FractalsStatistical Fractal Generation
General procedure:Initiator: start with a shapeGenerator: replace subparts with a self-similar random pattern
Random Midpoint Displacement
Advanced Modeling – FractalsStatistical Fractal Generation
Example: Terrain
20
Advanced Modeling – FractalsStatistical Fractal Generation
Useful for creating 3D plants
Advanced Modeling – FractalsStatistical Fractal Generation
Useful for creating 3D plants
21
Comparison of Solid RepresentationsAccuracy
Polygonal b-reps and voxels / octtrees: can only approximate shapes (often good enough)better: CSG, b-rep with curved surfaces, primitives
Domainlimited for primitive instancing, sweepsvoxels / octtrees and b-reps can represent a wide class of objects
Uniquenessonly 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 operationsprimitives cannot be combined at all; sweeps not closed under boolean operations
Efficient renderingeasy for (polygonal) b-repsharder for voxels / octrees
Compactnesshigh memory requirements for voxels / octtrees; better: CSG