<<

Lecture 2

Dr. Shuang LIANG School of Software Engineering Tongji University Fall 2012

3D Modeling, Advanced Shuang LIANG, SSE, Fall 2012 Lecturer

Dr. Shuang LIANG • Assisstant professor, SSE, Tongji – Education » B.Sc in Computer Science, Zhejiang University, 1999-2003 » PhD in Computer Science, Nanjing Univerisity, 2003-2008 » Visit in Utrecht University, 2007, 2008 – Research Fellowship » The Chinese University of Hong Kong, 2009 » The Hong Kong Polytechnic University, 2010-2011 » The City University of Hong Kong, 2012 • Contact – Office: Room 442, JiShi Building, JiaDing Campus, TongJi (Temporary) – Email: [email protected]

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 What is a 3D model?

 3D object using a collection of points in 3D space, connected by various geometric entities such as triangles, lines, curved surfaces, etc. It is a collection of data (points and other information)

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 What is a 3D modeling?

 The process of developing a mathematical representation of any three-dimensional surface of object via specialized software.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The medical industry uses detailed models of organs

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The movie industry uses them as characters and objects for animated and real-life motion pictures

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The science sector uses them as highly detailed models of chemical compounds

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The architecture industry uses them to demonstrate proposed buildings and landscapes through Software Architectural Models

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The architecture industry uses them to demonstrate proposed buildings and landscapes through Software Architectural Models

Microspot Interiors Professional is the award-winning 3D modeling software and interior design program for Mac. Design and envision interior home designs with the power and ease of Interiors. 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Usage of a 3D model

 The engineering community uses them as designs of new devices, vehicles and structures as well as a host of other uses

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Classic models in CG

 The Utah

 The "hello world" in CG

 A mathematical model of an ordinary teapot, which appears solid, cylindrical and partially convex.

 Created in 1975 by Martin Newell, a member of the pioneering graphics program at the University of Utah

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Classic models in CG

The original, physical teapot was purchased from ZCMI (a department store in Salt Lake City, Utah) in 1974. It was donated to the Boston Computer Museum in 1984 where it was on display until 1990. It now resides in the ephemera collection at the Computer History Museum in Mountain View, California where it is catalogued as "Teapot used for Computer Graphics rendering" (http://en.wikipedia.org/wiki/Utah_teapot)

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Classic models in CG

 The

 The Stanford Bunny is a computer graphics test model developed by Greg Turk and Marc Levoy in 1994 at Stanford University.

 The Bunny consists of data describing 69,451 triangles determined by 3D scanning a ceramic figurine of a rabbit.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Classic models in CG

 The Stanford Happy Buddha

 The Stanford buddha is a computer graphics test model created with a Cyberware 3030 MS at Stanford University.

 The Buddha consists of data describing 1,087,716 triangles determined by 3D scanning a real figurine.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Classic models in CG

 The Stanford Dragon

 The Stanford Dragon is a computer graphics test model created with a Cyberware 3030 MS at Stanford University.

 The Dragon consists of data describing 871,414 triangles determined by 3D scanning a real figurine.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Requirements for a 3D representation scheme

 Unambiguity : When you see a representation of a solid, you will know what is being represented without any doubt.  Uniqueness : That is, there is only one way to represent a particular solid. If a representation is unique, then it is easy to determine if two solids are identical since one can just compare their representations.  Accuracy : A representation is said accurate if no approximation is required.  Validness : This means a representation should not create any invalid or impossible solids. More precisely, a representation will not represent an object that does not correspond to a solid.  Closure : Solids will be transformed and used with other operations such as union and intersection. "Closure" means that transforming a valid solid always yields a valid solid.  Compactness and Efficiency : A good representation should be compact enough for saving space and allow for efficient algorithms to determine desired physical characteristics.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Point cloud • Range image • Solids • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Point cloud

 Unstructured samples

 Advantage: simplicity

 Disadvantage: no information on adjacency / connectivity

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Range image

 Image: stores a color along each of a set of regularly-spaced rays in space

 Range image: stores a depth along each of a set of regularly-spaced rays in space

 Obtained using devices known as range scanners

Vivid910, Laser scanner PMD, CamCube 3.0, TOF camera

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Range image

 Image: stores a color along each of a set of regularly-spaced rays in space

 Range image: stores a depth along each of a set of regularly-spaced rays in space

 Obtained using devices known as range scanners

2.5D range image 2D ear Range image with rendering

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Wireframe model • Constructive solid geometry • Voxels • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Wireframe model

 Wireframe model

 The oldest way of representing solids

 It represents shape of a solid object by its characteristics lines and points

 A wireframe model does not have face information

 A wireframe model consists of two tables, the vertex table and the edge table. Each entry of the vertex table records a vertex and its coordinate values, while each entry of the edge table has two components giving the two incident vertices of that edge

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Wireframe model For example, to represent a Edge Table defined by eight vertices and 12 Edge # Start Vertex End Vertex edges, one needs the following tables 1 1 2 2 2 3 Vertex Table 3 3 4 Vertex # x y z 4 4 1 1 1 1 1 5 5 6 2 1 -1 1 6 6 7 3 -1 -1 1 7 7 8 4 -1 1 1 8 8 5 5 1 1 -1 9 1 5 6 1 -1 -1 10 2 6 7 -1 -1 -1 11 3 7 8 -1 1 -1 12 4 8 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Wireframe model

 It is ambiguous

which one?

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Wireframe model • Constructive solid geometry • Voxels • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry

 CSG

 A CSG solid is constructed from a few primitives with Boolean operators Primitives: Cuboids(立方体), cylinders(圆柱体), prisms(棱柱), pyramids(角锥 体), spheres(球体), cones(圆锥), torus(圆环) Boolean operators: union, intersection, difference

Example:

A+B A^B A-B B-A 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry A CSG Example: we want to design a bracket-like shape with a hole shown on the right-most figure below 1. start with two blocks and one cylinder 2. two blocks are scaled and one of them is rotated 3. The cylinder is scaled 4. These three instantiations are then transformed to their desired positions 5. The final product is obtained by computing the union of the two blocks and then subtracting from it the cylinder.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry A CSG Example: The design procedure of the above model can be written as an expression: (trans(Block1) + trans(Block2)) - trans(Cylinder) This expression can be converted to an expression tree, the CSG Expression, of the design: Is CSG representation unique?

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry

 Implementation

 represent each elementary solid, e.g. cube, as a 3D field of values, negative on the inside and positive outside

 The CSG operations of union, intersection, and subtraction then become simple min/max operations on the 3D fields

 After all CSG operations are complete, the volume representation is converted to surfaces for rendering

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry

 Implementation Any object is defined on a unified domain Ω ; its interior and boundary has negative values, while its exterior has positive values objA: the positions of its valid closure have negative values; positions of its exterior have positive values; objB: the positions of its valid closure have negative values; positions of its exterior have positive values; Then, confused? Union (objA, objB) = min (objA, objB) Intersection (objA, objB) = max (objA, objB) Difference (objA, objB) = max(objA, -objB)

More explanations are needed here

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry

 Implementation An example to illustrate this in Matlab code is available on the course website!

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Constructive solid geometry

 It is often used in CAD tools

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Wireframe model • Constructive solid geometry • Voxels • Surfaces

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Voxels

 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

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Voxel Acquisition

 Scanning devices  Computed tomography (CT)  Magnetic resonance imaging (MRI)  Simulation

Siemens MRI Volume data example 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Voxel Acquisition

 Widely used in medical imaging

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces • Mesh • Subdivision • Parametric • Implicit 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh

Which Part?

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh

 Connected set of polygons (usually triangles)  Representation: Vertices, Indexed Face Set  Pros: flexible and computers can render them so quickly. So the vast majority of 3D models today are built as textured polygonal models  Cons: polygons are planar and can only approximate curved surfaces using many polygons

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Representation Key elements to represent a mesh? • Vertex (顶点) • Face (面) • Edge (边)

Main data structures • Face table (边表) • Winged edge (翼边) • ……

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Face Table (边表)

Each face is represented by vertex coordinates (坐标) 冗余的 • Redundant ( ) vertices (x4,y4,z4) • No adjacency (邻接) information

(x ,y ,z ) 3 3 3 f 2 f3

(x5,y5,z5) f1

(x1,y1,z1) (x2,y2,z2)

FACE TABLE

f1 (x1,y1,z1), (x2,y2,z2), (x3,y3,z3)

f2 (x2,y2,z2), (x4,y4,z4), (x3,y3,z3)

f3 (x2,y2,z2), (x5,y5,z5), (x4,y4,z4) 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Winged Edge (翼边) Edge-centered: adjacency encoded in edges (以边为中心) • Adjacent vertexes • Adjacent faces e22 • Adjacent edges e21 v2 Properties e F2 • All adjacencies in O(1) time F1 • A bit extra storage v1 • popular e12 e11

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Winged Edge (翼边)

v4 Example e4 e v3 7 f e5 2 f3 v e3 5 f e1 1 e6 v2 v1 e2

VERTEX TABLE EDGE TABLE 11 12 21 22 FACE TABLE v (x ,y ,z ) e1 e1 1 1 1 1 e1 (v1,v3) f1 e2 e2 e4 e3 f1 e6 v2 (x2,y2,z2) e2 (v1,v2) f1 e1 e1 e3 e6 f2 e3 v (x ,y ,z ) e3 e5 3 3 3 3 e3 (v2,v3) f1 f2 e2 e5 e1 e4 f3 v (x ,y ,z ) e5 4 4 4 4 e4 (v3,v4) f2 e1 e3 e7 e5 v (x ,y ,z ) e6 5 5 5 5 e5 (v2,v4) f2 f3 e3 e6 e4 e7

e6 (v2,v5) f3 e5 e2 e7 e7

e7 (v4,v5) f3 e4 e5 e6 e6 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Comparison

Data structure Face Vertex Edge Adjacency Storage

Face table Yes - - - High

Winged edge - - Yes V-E-F Edge-centered

“F” stands for face, “V” stands for vertex, and “E” stands for edge. “-” indicates the adjacency is encoded in the data structure.

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Subdivision

 Coarse mesh & subdivision rule  Define smooth surface as limit of sequence of refinements

…..

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Subdivision

 Coarse mesh & subdivision rule  Define smooth surface as limit of sequence of refinements

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • Fine mesh  coarse mesh • Basic function in mesh processing

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • How? • Edge collapse

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • How? • Vertex removal

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Mesh Simplification • More examples

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces • Mesh • Subdivision surface • Parametric surface • Implicit surface 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Parametric surface

 A parametric surface is a surface in the Euclidean space R3 which is defined by a parametric equation with two parameters ruv(,)= { xuv (,),(,),(,) yuv zuv} Examples:

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Outline

• What is a 3D model? • Usage of 3D models • Classic models in computer graphics • 3D model representations • Raw data • Solids • Surfaces • Mesh • Subdivision surface • Parametric surface • Implicit surface 3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Implicit surface

 Points satisfying Fxyz(, ,)= 0 Fxyz(, ,)< 0(x, y, z) inside the surface  In fact Fxyz(, ,)= 0(x, y, z) on the surface  Fxyz(, ,)> 0(x, y, z) outside the surface An example in 2D case (an implicit curve):

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Implicit surface An example

A mechanical model built by using implicit surface tool

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012 Thanks everybody!

Q & A?

3D Modeling, Advanced Computer Graphics Shuang LIANG, SSE, Fall 2012