70
Advanced Computer Graphics Spring 2008 K. H. Ko Department of Mechatronics Gwangju Institute of Science and Technology

Advanced Computer Graphics Spring 2008

  • Upload
    phuong

  • View
    58

  • Download
    0

Embed Size (px)

DESCRIPTION

Advanced Computer Graphics Spring 2008. K. H. Ko Department of Mechatronics Gwangju Institute of Science and Technology. Today ’ s Topics. Deformable Models in Computer Graphics Control Point Deformation. Deformable Models in Computer Graphics: Survey. Non-Physical Models - PowerPoint PPT Presentation

Citation preview

Page 1: Advanced Computer Graphics  Spring 2008

Advanced Computer Graphics Spring 2008

K. H. Ko

Department of MechatronicsGwangju Institute of Science and Technology

Page 2: Advanced Computer Graphics  Spring 2008

2

Today’s Topics Deformable Models in Computer

Graphics Control Point Deformation

Page 3: Advanced Computer Graphics  Spring 2008

3

Deformable Models in Computer Graphics: Survey Non-Physical Models

Purely geometric techniques They are generally computationally efficient. They rely on the skill of the designer rather than on physical pri

nciples.Splines and Patches

Bezier curves/surfaces, B-spline, NURBS, etc. Support interactive modification of shape. Subtle control of object shape is possible. But precise specification or modification of curves or surfaces

can be laborious.

Page 4: Advanced Computer Graphics  Spring 2008

4

Deformable Models in Computer Graphics: Survey Non-Physical Models

Free-Form Deformation (FFD) It is a general method for deforming objects that provides a higher and

more powerful level of control than adjusting individual control points. FFD changes the shape of an object by deforming the space in which t

he object lies though mapping. Ex.Twist about the z-axis

More complex deformations can be constructed by composing mappings.

Page 5: Advanced Computer Graphics  Spring 2008

5

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Non-physical methods for modeling deformation are limited by the expertise and patience of the user.

Deformations must be explicitly specified and the system has no knowledge about the nature of the object being manipulated.

Modeling an object as complex as the human face is a daunting task.

Therefore, physics is considered in the modeling.

Page 6: Advanced Computer Graphics  Spring 2008

6

Deformable Models in Computer Graphics: Survey Mass-Spring Models

They are physically based technique that has been used widely and effectively for modeling deformable objects.

An object is modeled as a collection of point masses connected by springs in a lattice structure.

The spring forces are linear/nonlinear.

Page 7: Advanced Computer Graphics  Spring 2008

7

Deformable Models in Computer Graphics: Survey Mass-Spring Models

The equation of motion for the entire system are assembled from the motions of all of the mass points in the lattice.

The system is evolved forward through time by re-expressing the equations as a system of first-order differential equations

Page 8: Advanced Computer Graphics  Spring 2008

8

Deformable Models in Computer Graphics: Survey Mass-Spring Models

They have been used widely in facial animation.Tension nets: static versions of mass-spring syst

ems. Kx = f. The face is modeled as a two-dimensional mesh of poi

nts warped around an ovoid and connected by linear springs.

Muscle actions are represented by the application of a force to a particular region of nodes.

Page 9: Advanced Computer Graphics  Spring 2008

9

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Dynamic mass-spring systems to facial modeling

A three-layer mesh of mass points based on three anatomically distinct layers of facial tissue:

The dermis A layer of subcutaneous fatty tissue The muscle layer

Page 10: Advanced Computer Graphics  Spring 2008

10

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Dynamic mass-spring systems to facial modeling Different spring constants were used to model the different layers based on

tissues properties. Facial models are created

Manually Using a radial laser-scanned image data Computer Tomography (CT)

Prediction of the post-operative appearance of patients whose underlying bone structure has been changed during cranio-facial surgery.

Spring stiffness for the system is derived from tissue densities obtained by CT image data.

Page 11: Advanced Computer Graphics  Spring 2008

11

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Mass-spring models combined with free-form deformations are used to animate muscles in human character animation.

A mass-spring model for deformable bodies is used to model a transition change from solid to liquid.

Mass-spring systems can be used to generate “artificial fish”.

Page 12: Advanced Computer Graphics  Spring 2008

12

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Advantages Simple, well understood dynamics Easy to construct. Can be animated at rates not possible with other

techniques Interactive and real-time simulation is possible. Well suited to parallel computation.

Page 13: Advanced Computer Graphics  Spring 2008

13

Deformable Models in Computer Graphics: Survey Mass-Spring Models

Drawbacks The discrete model is a significant approximation of

the true physics that occurs in a continuous body. Proper values of spring constants may not be easily

obtained. “Stiffness” issue: numerical instability would occur.

Large spring constants to model objects that are nearly rigid.

Page 14: Advanced Computer Graphics  Spring 2008

14

Deformable Models in Computer Graphics: Survey Continuum Models

Accurate physical models treat deformable objects as a continuum.

bodies with mass and energies distributed throughout.

Modeling itself can be derived based on the assumption of continuum. But ultimately computation is discrete.

Page 15: Advanced Computer Graphics  Spring 2008

15

Deformable Models in Computer Graphics: Survey Continuum Models

The full continuum model of a deformable object considers the EQUILIBRIUM of a general body acted on by external forces.

The object deformation is a function of the acting forces and the object’s material properties.

The object reaches equilibrium when its total energy is at a minimum.

П=Λ-W

Page 16: Advanced Computer Graphics  Spring 2008

16

Deformable Models in Computer Graphics: Survey Continuum Models

To determine the equilibrium shape of the object, Both Λ and W are expressed in terms of the object deformatio

n. Λ is the total strain energy of the deformable object W is the work done by external forces The total potential reaches a minimum when the derivative of

the total potential with respect to the material displacement function is zero.

This approach leads to a continuous differential equilibrium equation.

Page 17: Advanced Computer Graphics  Spring 2008

17

Deformable Models in Computer Graphics: Survey Continuum Models

A closed-form analytic solution of the differential equation is not always possible.

We instead find an approximate solution to the equation.

FEM method.

Page 18: Advanced Computer Graphics  Spring 2008

18

Deformable Models in Computer Graphics: Survey The use of FEM in computer graphics has

been limited because of the computational requirements. In real-time applications, it has proven difficult

to use FEM. The force vectors and the mass and stiffness

matrices are computed by integrating over the object, they must, in theory, be re-evaluated as the object deforms.

The re-evaluation is very costly.

Page 19: Advanced Computer Graphics  Spring 2008

19

Deformable Models in Computer Graphics: Survey FEM Methods

Advantage Provide a more physically realistic simulation than mass sprin

g methods with fewer node points.

Disadvantages Significant pre-processing time. If the topology of the object changes during the simulation, or

if the object shape changes beyond small deformation limits, the mass and stiffness matrices must be re-evaluated during the simulation.

Meshless approach???

Page 20: Advanced Computer Graphics  Spring 2008

20

Deformable Models in Computer Graphics: Survey Approximate Continuum Models

Physically motivated, but adhere less strictly to the laws of physics than the FEM methods.

Snakes One-dimensional deformable curves that are often

used to deform or define edges or contours or to tract motion in a moving image.

Discretized deformation energyHybrid models

Page 21: Advanced Computer Graphics  Spring 2008

21

Deformable Models in Computer Graphics: Survey Low Degree of Freedom Models

Discretization of the physically based models leads to systems with many degrees of freedom.

A large number of node points The systems are slow to simulate, limiting their use

in interactive and real time settings.Alternative approximate continuum models

They restrict the deformable object to many fewer degrees of freedom, sacrificing generality for speed.

Page 22: Advanced Computer Graphics  Spring 2008

22

Deformable Models in Computer Graphics: Survey Low Degree of Freedom Models

Modal AnalysisDynamic Global DeformationMinimal Energy Surfaces

Page 23: Advanced Computer Graphics  Spring 2008

23

Control Point Deformation A deformable body can be modeled as a

parametric surface with control points that are varied according to the needs of an application.

This approach is not physically based. But a careful adjustment of control points can make the surface deform in a manner that is convincing to the viewer.

Page 24: Advanced Computer Graphics  Spring 2008

24

Control Point Deformation Curves and Surfaces

Bezier, B-Spline, NURBS Cylinder Surfaces and Generalized Cylinder

Surfaces Revolution Surfaces Surfaces Built From Curves: Skinning or Lo

fting

Page 25: Advanced Computer Graphics  Spring 2008

25

Bezier Curves Mathematical Formulation

Bi,n(u) is called, the Bernstein Polynomial. The polygon joining Ri’s is called the control polygon.

Page 26: Advanced Computer Graphics  Spring 2008

26

Properties of Bezier Curves Geometry Invariance Properties

Bezier curves are invariant under translation and rotation.

We transform Bezier curves by transforming their control polygons only.

Relative position of control vertices is important in the generation of a Bezier curve.

Page 27: Advanced Computer Graphics  Spring 2008

27

Properties of Bezier Curves Endpoint Geometric Properties

The first and last control points are the endpoints of the curve.

The curve is tangent to the control polygon at the endpoints.

Page 28: Advanced Computer Graphics  Spring 2008

28

Properties of Bezier Curves Convex Hull Property

Page 29: Advanced Computer Graphics  Spring 2008

29

Properties of Bezier Curves Convex Hull Property is useful in

Intersection problems Detection of absence of interference. Providing the approximate position of curve through simple

bounds

Page 30: Advanced Computer Graphics  Spring 2008

30

Properties of Bezier Curves Variation Diminishing Property

A Bezier curve oscillates less than its polygon. The polygon’s segments exaggerate the oscillation of the curve. Useful in detecting the fairness of Bezier curves

Page 31: Advanced Computer Graphics  Spring 2008

31

Algorithms for Bezier Curves Evaluation and subdivision algorithm

A Bezier curve can be evaluated at a specific parameter value t0 and the curve can be split at that value using the de Casteljau algorithm.

The values bi0 are the original control points of the curve.

The value of the curve at parameter value t0 is bnn.

The curve can be represented as two curves, with control points and .

Page 32: Advanced Computer Graphics  Spring 2008

32

Algorithms for Bezier Curves

Page 33: Advanced Computer Graphics  Spring 2008

33

Bezier Surfaces A tensor product surface is formed by moving a curve

through space while allowing deformations in that curve. A Bezier surface with degrees m and n in u and v is

defined by

bij is called the control net. A Bezier surface inherits three properties

Geometry invariance, Endpoints geometric property and convex hull property.

No variation diminishing property is known.

Page 34: Advanced Computer Graphics  Spring 2008

34

Bezier Surfaces

Page 35: Advanced Computer Graphics  Spring 2008

35

Non Uniform B-splines Definition

Pi are n+1 control points. Ni,k(u) are piecewise polynomial B-spline basis functio

ns of order k with k-1 ≤ n. The parameter u obeys the inequality

Page 36: Advanced Computer Graphics  Spring 2008

36

Non Uniform B-splines Knot vector

For open (non-periodic) curves, it is usual to define a set T of non-decreasing real numbers which is called the know vector.

The total number of knots is n+k+1.

Page 37: Advanced Computer Graphics  Spring 2008

37

Non Uniform B-splines Properties and definition of basis function

Page 38: Advanced Computer Graphics  Spring 2008

38

Non Uniform B-splines Properties and definition of basis function

Page 39: Advanced Computer Graphics  Spring 2008

39

Non Uniform B-splines 2nd order B-spline basis function

Page 40: Advanced Computer Graphics  Spring 2008

40

Non Uniform B-splines 3rd order B-spline basis function

Page 41: Advanced Computer Graphics  Spring 2008

41

Non Uniform B-splines 4th order B-spline basis function (Cubic B-splin

e)

Page 42: Advanced Computer Graphics  Spring 2008

42

Non Uniform B-splines

Page 43: Advanced Computer Graphics  Spring 2008

43

Non Uniform B-splines Properties

Local supportConvex hull (stronger than Bezier)Each span is in the convex hull of the k vertices

contributing to its definitionConsequence: k consecutive vertices are collinear

Span is a straight line segmentVariation diminishing property as for Bezier curvesExploit knot multiplicity to make complex curves.

Page 44: Advanced Computer Graphics  Spring 2008

44

Non Uniform B-splines Special Case : n = k - 1

The B-spline curve is also a Bezier curve in this case.

Derivatives

Page 45: Advanced Computer Graphics  Spring 2008

45

Non Uniform B-splines Design with B-spline curves

Procedure A Designer chooses knot vector and control points. Designer displays a curve and tweaks control points to im

prove the curve.Procedure B

Designer starts with data points on or near curve. Construct an interpolating/approximating B-spline curve. Display curve and tweak control points to improve the cu

rve.

Page 46: Advanced Computer Graphics  Spring 2008

46

Non Uniform B-splines Evaluation and subdivision of B-splines

De Boor Algorithm for B-spline curve evaluation

Page 47: Advanced Computer Graphics  Spring 2008

47

Non Uniform B-splines Evaluation and subdivision of B-splines

De Boor Algorithm for B-spline curve evaluation

Page 48: Advanced Computer Graphics  Spring 2008

48

Non Uniform B-splines Knot Insertion: Boehm’s algorithm

Page 49: Advanced Computer Graphics  Spring 2008

49

Tensor Product Polynomial Surface Patches

Tensor product surfaceLet be 3D curve.Let this curve sweep a surface by moving and possib

ly deforming by letting each Ri trace a curve.

The resulting surface is a tensor product surface.

Page 50: Advanced Computer Graphics  Spring 2008

50

Tensor Product Polynomial Surface Patches

Page 51: Advanced Computer Graphics  Spring 2008

51

Tensor Product Polynomial Surface Patches

Bezier patch

Page 52: Advanced Computer Graphics  Spring 2008

52

Tensor Product Polynomial Surface Patches

Properties of Bezier Patches Lines of v=constant (isoparametric line) are Bezier curves of

degree n with control points

The boundary isoparameter lines have the same control points as the corresponding polyhedron points.

The relation between the patch and Bezier net is affinely invariant.

Convex hull. No known variation diminishing property.

Page 53: Advanced Computer Graphics  Spring 2008

53

Tensor Product Polynomial Surface Patches

B-spline Patch

Page 54: Advanced Computer Graphics  Spring 2008

54

Tensor Product Polynomial Surface Patches

Properties of B-spline PatchesObeys some properties as a Bezier patch to which it r

educes for n = k -1 and m = l - 1.Easy construction of complex piecewise continuous

geometries.Local Control

Strong convex hull

Page 55: Advanced Computer Graphics  Spring 2008

55

Generalization of B-splines to NURBS NURBS – Non-uniform rational B-splines

Same properties as B-splinesCapable of representing a wider class of geometries

Curves

This formulation permits exact representation of conics, i.e. circle, ellipse, hyperbola, etc.

Page 56: Advanced Computer Graphics  Spring 2008

56

Generalization of B-splines to NURBS Surfaces

This formulation allows for exact representation of quadrics, tori, surfaces of revolution and very general free-form surfaces.

Page 57: Advanced Computer Graphics  Spring 2008

57

Generalization of B-splines to NURBS Example

Representation of a quarter circle as a rational polynomial

For the conversion to the Bezier representation, apply

Separately to numerators and denominators to obtain the Bezier form.

Page 58: Advanced Computer Graphics  Spring 2008

58

Trimmed Patches R(u,v) is an untrimmed patch in the parametric domain (u,

v) in [A,B]× [C,D] Describe external loop as a set of edges, i.e. curves in par

ameter space ri(t)=[ui(ti),vi(ti)]. External loop is made up of {r1,r2,r3,r4,r5}, while the internal lo

op is made up of a curve {r6}.

Page 59: Advanced Computer Graphics  Spring 2008

59

Generalized Cylinders A generalized cylinder is a repr

esentation of an elongated object viewed as having a main axis (directrix or spine) and a smoothly varying cross section (generatrix). Representation of measured data

(CAT scans, deformed solids) Representation of manufacturing

processes Representation of blends Object recognition and scene inter

pretation in robotics and computer vision

Representation of human and animal shapes

Page 60: Advanced Computer Graphics  Spring 2008

60

Generalized Cylinders Given

A bounded 3-D curve serving as spine.A cross-sectional plane swept along the spine

perpendicular to it so that the spine passes through the origin of the 2-D coordinate system on the plane.

A cross-sectional curve on the cross-section plane defined locally in the cross-section coordinate system, where the size and shape of the curve may vary with the parameter along the spine curve.

Page 61: Advanced Computer Graphics  Spring 2008

61

Generalized Cylinders The surface swept by the cross-sectional curve is a g

eneralized cylinder Cylinder

Spine : straight line Generatrix : circle

Torus Spine : circle Generatrix : circle

Cone Spine : straight line segment Generatrix : linearly tapering circles

Page 62: Advanced Computer Graphics  Spring 2008

62

Generalized Cylinders Mathematical Description of Generalized Cyli

ndersDirectrix (spine)

Generatrix

Generalized cylinder surface patch

X, Y, Z can be the Frenet trihedron.

Page 63: Advanced Computer Graphics  Spring 2008

63

Generalized Cylinders Mathematical Description of Generalized Cyli

ndersGeneralized Cylinders with B-spline Spline and G

eneratrix Curves

Pipe Surfaces

Page 64: Advanced Computer Graphics  Spring 2008

64

Generalized Cylinders Degeneracies of Generalized Cylinders

Local and Global Self-Intersections

Page 65: Advanced Computer Graphics  Spring 2008

65

Generalized Cylinders A condition to avoid local self-intersection of

generalized cylinders

Page 66: Advanced Computer Graphics  Spring 2008

66

Generalized Cylinders Global self-intersections (of a pipe surface)

End circle to end circleBody to bodyEnd circle to body

Page 67: Advanced Computer Graphics  Spring 2008

67

Generalized Cylinders Discrete Generalized Cylinders

1. Define a piecewise continuous spine.2. Obtain point measurements on cross-section curves on planes perpe

ndicular to the spine at a discrete set of points on the spine.3. Construct a local system of coordinates on each cross-section with

origin on the spine.4. Interpolate each cross-section with splines and establish parametric

correspondence between cross-sections.5. Establish an interpolation rule between cross-sections.

Page 68: Advanced Computer Graphics  Spring 2008

68

Revolution Surfaces

A revolution surface is obtained by revolving a curve about a line that does not intersect the curve.

The rotation line is the z-axis. The curve is (x(u),z(u)) in the xz-plane The surface is parameterized as

2]1,0[),())(),2sin()(),2cos()((),( vuforuzvuxvuxvuX

Page 69: Advanced Computer Graphics  Spring 2008

69

Surfaces Built From Curves

In general curves are easier to work with. Define curves first and then create a surface using them.

Page 70: Advanced Computer Graphics  Spring 2008

70

Implicit Surface Deformation

A body is modeled as the region F(x,y,z) ≤ 0 for a suitably chosen function F.

The surface of the body is implicitly defined by F(x,y,z) = 0.

A force on the body is simulated by adding a deformation function D(x,y,z) to F(x,y,z).

The deformed body is the region F(x,y,z) + D(x,y,z) ≤ 0 and has a surface implicitly defined by F(x,y,z) + D(x,y,z) = 0.