surfaces

56
Surfaces Chiew-Lan Tai

Upload: max

Post on 04-Feb-2016

38 views

Category:

Documents


0 download

DESCRIPTION

Surfaces. Chiew-Lan Tai. Reading. Required Hills Section 11.11 Hearn & Baker, sections 8.11, 8.13 Recommended Sections 2.1.4, 3.4-3.5, 3D Computer Graphics, Watt. Mathematical surface representations. Explicit z = f(x,y) (a.k.a. “height field”) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Surfaces

SurfacesSurfaces

Chiew-Lan Tai

Page 2: Surfaces

2

Surfaces

Reading

Required Hills Section 11.11 Hearn & Baker, sections 8.11, 8.13

Recommended Sections 2.1.4, 3.4-3.5, 3D Computer

Graphics, Watt

Page 3: Surfaces

3

Surfaces

Mathematical surface representations Explicit z = f(x,y) (a.k.a. “height field”) What if the surface isn’t a function?

Implicit g(x,y,z) = 0 x2 + y2 + z2 = 1

Parametric S(u,v) = (x(u,v), y(u,v), z(u,v)) x(u,v) = r cos 2v sinu y(u,v) = r sin 2v sinu z(u,v) = r cos u 0≤u≤1, 0≤v≤1

Page 4: Surfaces

4

Surfaces

Tensor product Bézier surfaces

Given a grid of control point Vij, forming a control net, construct a surface S(u,v) by:

Each row in u-direction is control points of a curve Vi(u).

V0(u), …, Vn(u) at a specific u are the control points of a curve parameterized by v (i.e. S(u,.v))

Page 5: Surfaces

5

Surfaces

Tensor product Bezier surfaces, cont. Let’s walk through the steps:

Which control points are interpolated by the surface? Only the 4 corner points

Page 6: Surfaces

6

Surfaces

Tensor product Bezier surfaces, cont. Writing it out explicitly: Linear Bezier surface:

Quadratic Bezier surface?

])1[(

])1)[(1(),(

1110

0100

VV

VVS

uuv

uuvvu

Page 7: Surfaces

7

Surfaces

Matrix form

For the case of cubic Bezier surface:

Page 8: Surfaces

8

Surfaces

Tensor product B-spline surfaces

Like spline curves, we can piece together a sequence of Bezier surfaces to make a spline surface. If we enforce C2 continuity and local control, we get B-spline curves:

Page 9: Surfaces

9

Surfaces

Tensor product B-spline surfaces

Use each row of B control points in u to generate Bezier control points in u. Treat each row of Bezier control points in v direction as B-spline control points to

generate Bezier control points in v direction.

u

Page 10: Surfaces

10

Surfaces

Tangent plane and surface normal

S

S

Page 11: Surfaces

11

Surfaces

Partial Derivatives

0

1

2

3

]1[),(

2

23 u

u

MVMvvvvuSu

TBezierBezier

1

]0123[),(2

3

2

u

u

u

MVMvvvuSv

TBezierBezier

Page 12: Surfaces

12

Surfaces

Surface normal

S

S S

S

Page 13: Surfaces

13

Surfaces

Other construction methods

Page 14: Surfaces

14

Surfaces

Rotational surfaces (surface of revolution) Rotate a 2D profile curve about an axis

Page 15: Surfaces

15

Surfaces

Profile curve, C(u)

Constructing surfaces of revolution Given a curve C(u) in the yz-plane:

Let Ry() be a rotation about the y-axis Find: A surface S(u,v) obtained by applying Ry() on C(u)

S(u,v) = Ry(v) [0, Cy(u), Cz(u), 1]t

y

xz

Page 16: Surfaces

16

Surfaces

Surface of revolution

Profile curve on yz plane:

C(u) = ( 0, Cy(u), Cz(u) )

The surface S(u,v) obtained by rotating C(u) about the y-axis is

S(u,v) = ( -Cz(u) sin(v), Cy(u), Cz(u) cos(v))

y

z

x

Page 17: Surfaces

17

Surfaces

General sweep surface

Given a planar profile curve C(u) and a general space curve T(v) as the trajectory, sweep C(u) along the trajectory

How to orient C(u) as it moves along T(v)?

Page 18: Surfaces

18

Surfaces

Orientating C(u) Define a local coordinate frame at any point along the trajectory The Frenet frame (t,n,b) is the natural choice

As we move along T(v), the Frenet frame (t,b,n) varies smoothly (inflection points where curvature goes to zero needs special treatment)

Page 19: Surfaces

19

Surfaces

Sweep Surfaces

Orient the profile curve C(u) using the Frenet frame of the trajectory T(v): Put C(u) in the normal plane. Place Oc at T(v). Align xc of C(u) with b. Align yc of C(u) with n.

Sweep surface

S(u,v) = T(v) + n(v)Cx(u) + b(v) Cy(u)

Page 20: Surfaces

20

Surfaces

Variations

Several variations are possible: Scale C(u) as it moves, possibly using length of T(v) as a

scale factor. Morph C(u) into some other curve C’(u) as it moves along

T(v)

Page 21: Surfaces

21

Surfaces

Summary

What to take home: How to construct tensor product Bezier surfaces How to construct tensor product B-spline surfaces How to construct surfaces of revolution How to construct sweep surfaces from a profile and a

trajectory curve with a Frenet frame

Page 22: Surfaces

22

Surfaces

Subdivision SurfacesWhat’s wrong with B-spline/NURBS surfaces?

Page 23: Surfaces

23

Surfaces

Subdivision curves

Idea: repeatedly refine the control polygon

curve is the limit of an infinite process.

i

i

PC

PPP

lim

210

Page 24: Surfaces

24

Surfaces

Subdivision curves

Page 25: Surfaces

25

Surfaces

Chaikin’s algorithm In 1974, Chaikin introduced the following “corner-

cutting” scheme: Start with a piecewise linear curve Repeat

Insert new vertices at the midpoints (the splitting step)

Average two neighboring vertices (the average step)

Averaging mask(0.5, 0.5)

With this averaging mask, in the limit, the resulting curve is a quadratic B-spline curve.

Page 26: Surfaces

26

Surfaces

Local subdivision mask Subdivision mask: ¼ (1, 2, 1) Splitting and averaging:

Applying the step recursively, each vertex converges to a specific point

With this mask, in the limit, the resulting curve is a cubic B-spline curve.

Page 27: Surfaces

27

Surfaces

General subdivision process

After each split-average step, we are closer to the limit surface.

Can we push a vertex to its limit position without infinite subdivision? Yes!

We can determine the final position of a vertex by applying the evaluation mask. The evaluation mask for cubic B-spline is 1/6 (1,4, 1)

Page 28: Surfaces

28

Surfaces

DLG interpolating scheme (1987)

Algorithm: splitting step introduces midpoints, and averaging step

only changes these midpoints Dyn-Levin-Gregory scheme:

Page 29: Surfaces

29

Surfaces

Building Complex Models

This simple idea can be extended to build subdivision surfaces.

Page 30: Surfaces

30

Surfaces

Subdivision surfaces Iteratively refine a control polyhedron (or control mesh) to

produce the limit surface using splitting and averaging step:

There are two types of splitting schemes: vertex schemes face schemes

Page 31: Surfaces

31

Surfaces

Vertex schemes

A vertex surrounded by n faces is split into n subvertices, one for each face:

Doo-Sabin subdivision:

Page 32: Surfaces

32

Surfaces

Face schemes Each quadrilateral face is split into four subfaces:

Catmull-Clark subdivision:

Page 33: Surfaces

33

Surfaces

Face scheme, cont.

Each triangular face is split into four subfaces:

Loop subdivision:

Page 34: Surfaces

34

Surfaces

Averaging step Averaging masks:

nn

QQQnQ n

)(

)( 1

Page 35: Surfaces

35

Surfaces

Adding creases Sometimes, a particular feature such as a crease should be

preserved. we just modify the subdivision mask.

This gives rise to G0 continuous surfaces.

Page 36: Surfaces

36

Surfaces

Creases

Here’s an example using Catmull-Clark surfaces:

Page 37: Surfaces

Spatial Object DeformationSpatial Object Deformation

Page 38: Surfaces

38

Surfaces

Object Deformation

Many objects are not rigid jello, mud, gases, liquids

In animation, to give characterization to rigid objects stretch and squash

Two main classes of techniques Geometric-based Physically-based

Page 39: Surfaces

39

Surfaces

Geometric Deformations

Deform the object’s geometry directly control point / vertex manipulation

Deform the object’s geometry indirectly Warp the space in which the object is

embedded (Spatial Deformation) Main techniques

Nonlinear Deformation (Barr) Free Form Deformation (FFD) Curve-based Deformation

Page 40: Surfaces

40

Surfaces

Spatial Deformation: General framework

Warps the space that the mesh is embedded in

User inputs pairs of features to guide the deformations point pairs local coordinate frames continuous curves

Page 41: Surfaces

41

Surfaces

Spatial Deformation: General framework

User inputs pairs of features to guide the deformations discrete point pairs local coordinate frames Continuous curves

Page 42: Surfaces

42

Surfaces

Spatial Deformation: General framework

Spatial deformation defines a mapping on the space that surrounds the model It can be performed on any models that use

point-based data pixels in images control points in spline surfaces Vertices in mesh point cloud data

Deformation is propagated along the space May not be what the user expects

Page 43: Surfaces

43

Surfaces

Freeform Deformation (FFD)[Sederberg and Parry 1986]

Page 44: Surfaces

44

Surfaces

Freeform Deformation (FFD)[Sederberg and Parry 1986]

Define a volume using parallelepiped lattice

Lattice defines a coordinate system (S,T,U)

Modify the lattice points

Deformation of a point in the space depends on its (s,t,u) coordinates

Page 45: Surfaces

45

Surfaces

Freeform Deformation (FFD)

ijk

kjiijk uBtBsButs )()()(),,( pPThe lattice defines a Bezier volume:

determine its lattice coordinates (s, t, u)

Alter the lattice points ijkp

For each object point v,

New position of v is evaluated as P(s,t,u)

Page 46: Surfaces

46

Surfaces

Freeform Deformation (FFD)[Sederberg and Parry 1986]

Page 47: Surfaces

47

Surfaces

Freeform Deformation (FFD)[Sederberg and Parry 1986]

Page 48: Surfaces

48

Surfaces

Axial Deformation [Lazarus 1994]

Page 49: Surfaces

49

Surfaces

Axial Deformation [Lazarus 1994]

x(u)

Y(u)

P

x’(u)

y’(u) P’

Source curve R(u) target curve T(u)

y(u)))u(RP()u(t

x(u)))u(RP()u(s

(u)y'(u)t(u)x'(u)s(u)TP '

R(u) T(u)

Page 50: Surfaces

50

Surfaces

Wires” [Singh and Fiume 1998]

Defined curves “bound” on the surface User deforms the mesh by editing the curves The original and modified curves are feature pairs

Includes local rotation and scaling controls Provide smooth composite deformation for multiple

curve features

Page 51: Surfaces

Rendering Techniquesleading to geometry illusions

Rendering Techniquesleading to geometry illusions

Page 52: Surfaces

52

Surfaces

Texture Mapping Add surface texture, or colour to a computer-

generated graphic or 3D model texture map is applied (mapped) to the

surface of a shape It is a rendering technique

Page 53: Surfaces

53

Surfaces

Bump Mapping (normal mapping) A perturbation to the surface normal at each pixel of

the object being rendered look up in a height map and apply before the

illumination calculation is done Normal map is the most commonly used technique It is a rendering technique

Bump mapw/o bump mapping

With bump mapping,same geometry butrendered with detailed normals

Page 54: Surfaces

54

Surfaces

Displacement mapping

An alternative technique in contrast to bump mapping

using a texture- or height map to displace the actual geometric position Displacements are often along the

local surface normal Can be modeling OR rendering

technique

Page 55: Surfaces

55

Surfaces

Displacement mappingDisplacement maps

Displaced Surfaces

Page 56: Surfaces

56

Surfaces

Alpha Mapping Specify transparency level at each pixel of the object

being rendered It is a rendering technique