14 computer animation - cgl @ ethz · – solve partial differential equation on (regular) grid –...

35
1 Introduction to Computer Animation

Upload: others

Post on 19-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

1

Intro

du

ction

toC

om

pu

ter An

ima

tion

Page 2: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

2

Co

mp

uter A

nim

atio

n 2

Mo

tivatio

n

•A

nim

atio

n fro

m anim

a(la

t.) =

soul, spirit, breath of life•

Brin

g im

ag

es to

life!

•E

xa

mp

les

–C

ha

racte

r an

ima

tion

(h

um

an

s, an

ima

ls)

–S

eco

nd

ary m

otio

n (h

air, clo

th)

–P

hysica

l wo

rld (rig

id b

od

ies, w

ate

r, fire)

Page 3: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

3

Co

mp

uter A

nim

atio

n 3

An

ima

tion

Tech

niq

ues

•Fo

r cha

racte

r an

ima

tion

–K

eyfra

min

g

–M

otio

n ca

ptu

ring

/ mo

tion

synth

esis

•Fo

r seco

nd

ary m

otio

n, p

hysica

l effe

cts

–P

roce

du

ral

–S

imu

latio

n (p

hysica

lly ba

sed

an

ima

tion

)

Page 4: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

4

Co

mp

uter A

nim

atio

n 4

Keyfra

min

g

•A

rtistd

efin

es ke

y fram

es

•C

om

pu

ter in

terp

ola

tes

Page 5: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

5

Co

mp

uter A

nim

atio

n 5

Mo

tion

Ca

ptu

ring

•V

ario

us te

chn

iqu

es (m

ag

ne

tic, me

cha

nica

l, op

tical):

•O

utp

ut: T

raje

ctorie

s of a

set o

f ma

rkers

Page 6: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

6

Co

mp

uter A

nim

atio

n 6

Mo

tion

Synth

esis

•C

om

bin

e re

cord

ed

mo

tion

sCo

urte

sy Oka

nA

rikan

•P

rob

lem

s

–N

atu

ral tra

nsitio

ns

–In

tera

ction

with

en

viron

me

nt

(foo

t slidin

g, co

llision

s)

Page 7: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

7

Co

mp

uter A

nim

atio

n 7

An

ima

tion

Tech

niq

ues

•Fo

r cha

racte

r an

ima

tion

–K

eyfra

min

g

–M

otio

n ca

ptu

ring

/ mo

tion

synth

esis

•Fo

r seco

nd

ary m

otio

n, p

hysica

l effe

cts

–P

roce

du

ral

–S

imu

latio

n (p

hysica

lly ba

sed

an

ima

tion

)

Page 8: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

8

Co

mp

uter A

nim

atio

n 8

Pro

cedu

ral A

nim

atio

n

•O

cea

n su

rface

as su

pe

rpo

sition

of sin

e w

ave

s

Hin

sing

eret. a

l.

•P

lan

t gro

wth

an

ima

ted

with

L-System

s (Gra

mm

ar)

•P

roce

du

re a

nim

ate

s scen

e e

xp

licitly

Page 9: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

9

Co

mp

uter A

nim

atio

n 9

Pro

cedu

ral vs. Sim

ula

tion

•P

roce

du

ral a

nim

atio

n

–E

xp

licit de

scriptio

n o

f effe

ct

–S

imp

le to

con

trol

–H

ard

to m

od

el co

mp

lex

effe

cts / inte

ractio

ns

•S

imu

latio

n

–In

teg

ratio

n o

f ph

ysical e

qu

atio

ns (e

.g. N

ew

ton

)

–H

ard

er to

con

trol

–U

nlim

ited

com

ple

xity

(bo

un

d o

nly b

y com

pu

ting

time

)

Page 10: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

10

Co

mp

uter A

nim

atio

n 10

Ph

ysical Sim

ula

tion

s

•E

qu

atio

ns kn

ow

n fo

r a lo

ng

time

–M

otio

n (N

ew

ton

, 166

0)

–E

lasticity (H

oo

ke, 16

70)

–Flu

ids (N

avie

r, Sto

kes, 18

22)

•S

imu

latio

n m

ad

e p

ossib

le b

y com

pu

ters

–19

38:

Zu

se1, 0

.2 flop

s,

–20

04

: NE

C's E

arth

Sim

ula

tor

36 te

raflo

ps

fv

=)

(/

mdt

d

σ=

vg

vv

v2

∇+

+∇

−=

∇⋅+

∂ ∂µ

ρρ

ρk

t

Page 11: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

11

Co

mp

uter A

nim

atio

n 11

Aim

of P

hysica

l Simu

latio

ns

•C

om

pu

tatio

na

l Scie

nce

s

–P

erfe

ctre

plica

tion

of th

ere

al w

orld

–S

imu

latio

ns

rep

lace

ex

pe

nsive

ex

pe

rime

nts

–A

ccura

cym

ore

imp

orta

nt

tha

nsp

ee

d

•C

om

pu

ter A

nim

atio

n

–P

lau

sible

be

ha

vior

(use

r/ vie

we

rm

ust

be

con

vince

d)

–C

on

trolla

bility

–S

pe

ed

an

d sta

bility

(for

rea

l-time

use

)

Page 12: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

12

Co

mp

uter A

nim

atio

n 12

Rea

l-Tim

e P

hysica

lly Ba

sed A

nim

atio

n

•T

rad

e a

ccura

cy for sp

ee

d“Cheat as m

uch as you can without getting caught”•

Un

con

ditio

na

l stab

ility

•A

pp

licatio

ns:

Fligh

t/car S

imu

lato

rs3D

Ga

me

sS

urg

ery train

ers

Page 13: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

13

Co

mp

uter A

nim

atio

n 13

Exa

mp

les

Brittle

De

form

ab

leLiq

uid

Page 14: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

14

Co

mp

uter A

nim

atio

n 14

Tech

niq

ues

•P

article

system

s–

Fire, sm

oke

, wa

ter

•M

ass-sp

ring

system

s–

De

form

ab

le o

bje

cts

•R

igid

bo

dy sim

ula

tion

–C

ars, a

irpla

ne

s, furn

iture

,…

•G

rid b

ase

d m

eth

od

s–

Wa

ter, sm

oke

, airflo

w

•O

the

rs, e.g

. Finite

Ele

me

nts, …

Page 15: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

15

Co

mp

uter A

nim

atio

n 15

Pa

rticle Systems

Wa

ter Fire

Sn

ow

, du

st, san

dS

mo

ke

Page 16: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

16

Co

mp

uter A

nim

atio

n 16

Pa

rticle Systems

•C

olle

ction

of m

an

y sm

all sim

ple

pa

rticles

•P

article

mo

tion

in

flue

nce

d b

y force

s

•G

en

era

ted

by e

mitte

rs

•D

ele

ted

wh

en

lifetim

e

rea

che

d o

r ou

t of sce

ne

mi

vi

ge

ne

rato

r

fi

Page 17: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

17

Co

mp

uter A

nim

atio

n 17

Pa

rticle System A

nim

atio

n

•N

ew

ton

’s seco

nd

law

of m

otio

n

)(

1)

(

)(

)(

tm

tdt d

tt

dt d

ii

i

ii

fv

vx

= =

•S

imp

le u

pd

ate

rule

(inte

gra

tion

me

tho

d)

ii

i

ii

ii

tm t

vx

x

fv

v

⋅∆

+←

∆+

←1

Page 18: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

18

Co

mp

uter A

nim

atio

n 18

Force C

om

pu

tatio

n

•M

ultip

le in

flue

nce

s:

⋅−

=

i

i

mg 0 0

gravityf

ii

dvf

−=

damping

),

(external

ti

ix

ff

=∑ =j

ji

i)

,(

interactx

xf

finteractexternal

damping

gravityi

ii

ii

ff

ff

f+

++

=

•A

dd

ition

of in

flue

nce

s:

Page 19: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

19

Co

mp

uter A

nim

atio

n 19

Tech

niq

ues

•P

article

system

s–

Fire, sm

oke

, wa

ter

•M

ass-sp

ring

system

s–

De

form

ab

le o

bje

cts

•R

igid

bo

dy sim

ula

tion

–C

ars, a

irpla

ne

s, furn

iture

,…

•G

rid b

ase

d m

eth

od

s–

Wa

ter, sm

oke

, airflo

w

Page 20: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

20

Co

mp

uter A

nim

atio

n

20

Ma

ss-Sprin

g System

s

•P

article

system

p

lus sp

ring

s

•S

pe

cial in

tera

ction

force

{} (

)0

i

0i

0i

xx

xx

xx

f− −

−−

=∑∈

iii

iL

k3,2,

1|

interact0

0x

3x

2x

1x

11 ,k

L

22 ,k

L

33 ,k

L

stiffness

rest le

ng

th

Page 21: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

21

Co

mp

uter A

nim

atio

n 21

Ap

plica

tion

s

Facia

l an

ima

tion

Stra

sser

Ku

eh

na

pfe

lT

ha

lma

nn

Clo

th sim

ula

tion

Su

rge

ry simu

latio

n

Page 22: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

22

Co

mp

uter A

nim

atio

n 22

Issues

•W

he

re to

pu

t sprin

gs

•C

ho

ice o

f stiffne

sses

•C

ollisio

n d

ete

ction

•C

ollisio

n re

spo

nse

•S

tab

ility (time

step o

r stiffne

ss too

hig

h)

ii

i

ii

ii

tm t

vx

x

fv

v

⋅∆

+←

∆+

←1

rest co

nfig

ura

tion

ove

rcorre

ction

Page 23: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

23

Co

mp

uter A

nim

atio

n 23

Tech

niq

ues

•P

article

system

s–

Fire, sm

oke

, wa

ter

•M

ass-sp

ring

system

s–

De

form

ab

le o

bje

cts

•R

igid

bo

dy sim

ula

tion

–C

ars, a

irpla

ne

s, furn

iture

,…

•G

rid b

ase

d m

eth

od

s–

Wa

ter, sm

oke

, airflo

w

Page 24: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

24

Co

mp

uter A

nim

atio

n 24

Rig

id B

od

y Simu

latio

n

•D

efo

rma

ble

ob

jects h

ave

m

an

y de

gre

es o

f free

do

m

•E

ach

verte

x is sim

ula

ted

sep

ara

tely

•A

rigid

bo

dy o

nly h

as

6 d

eg

ree

s of fre

ed

om

•Fa

ster sim

ula

tion

po

ssible

orie

nta

tion

po

sition

Page 25: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

25

Co

mp

uter A

nim

atio

n 25

States o

f a R

igid

Bo

dy

•S

tatic sta

tes

–P

ositio

n x

–O

rien

tatio

n R

•D

yna

mic sta

tes

–Lin

ea

r velo

city v–

An

gu

lar ve

locity ω

Rx

v

ω

Page 26: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

26

Co

mp

uter A

nim

atio

n 26

Simu

latio

n o

f Rig

id B

od

ies

•N

ew

ton

’s law

of m

otio

n

=

)()(

)(

)( ~

)(

)(

)(

)( )( )(

t tt

tt

tt

tM

t t

dt d

τ FR

ωv

ωIv R x

•U

se in

teg

ratio

n m

eth

od

to

up

da

te sta

tes

Page 27: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

27

Co

mp

uter A

nim

atio

n 27

Issues

•C

ollisio

n d

ete

ction

•C

ollisio

n re

spo

nse

for

com

ple

x co

nfig

ura

tion

s

•C

on

strain

ts (join

ts)

Page 28: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

28

Co

mp

uter A

nim

atio

n 28

Ap

plica

tion

s

•R

ob

otic sim

ula

tion

s

•3D

com

pu

ter g

am

es

Ha

lf Life

Page 29: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

29

Co

mp

uter A

nim

atio

n 29

Tech

niq

ues

•P

article

system

s–

Fire, sm

oke

, wa

ter

•M

ass-sp

ring

system

s–

De

form

ab

le o

bje

cts

•R

igid

bo

dy sim

ula

tion

–C

ars, a

irpla

ne

s, furn

iture

,…

•G

rid b

ase

d m

eth

od

s–

Wa

ter, sm

oke

, airflo

w

Page 30: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

30

Co

mp

uter A

nim

atio

n

30

Grid

Ba

sed M

etho

ds

•B

asic id

ea

:

–S

olve

pa

rtial d

iffere

ntia

l eq

ua

tion

o

n (re

gu

lar) g

rid

–R

ep

lace

diffe

ren

tials b

y finite

diffe

ren

ces

Page 31: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

31

Co

mp

uter A

nim

atio

n 31

Exa

mp

le: Wa

ter Surfa

ce

•W

ate

r surfa

ce d

efin

ed

as h

eig

ht u(x,y,t)

at lo

catio

n x,y

at tim

e t)

(2 2

2 22

2 2

uy

ux

cu

t∂ ∂

+∂ ∂

=∂ ∂

u(x,y,t)(x,y)•

Dyn

am

ics give

n b

y 2D

wa

ve e

qu

atio

n:

Page 32: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

32

Co

mp

uter A

nim

atio

n 32

Discretiza

tion

•R

ep

lace

con

tinu

ou

s u(x,y,t)b

y discre

te a

rray

ut[i,j]

(grid

spa

cing

h)

•R

ep

lace

de

rivative

s by fin

ite d

iffere

nce

s, e.g

. ∂u/∂

x = (u

t[i+1,j]-u

t[i,j])/h•

Sim

ple

up

da

te sch

em

e (w

ith co

ol re

sults!)

22

1]

,[4

]1,[

]1,[

],1

[]

,1[

],[

],[

hct

ji

vj

iv

ji

tuj

itu

ji

tuj

itu

ji

tut

t−

−+

++

−+

+∆

+=

+

],[

],[

],[

11

ji

vtj

iu

ji

ut

tt

++

∆+

=

Page 33: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

33

Co

mp

uter A

nim

atio

n 33

Bo

un

da

ry Co

nd

ition

s

•A

ssum

ing

i∈(1,..,n)

•P

erio

dic:

ut[0,j]=

ut[n,j], u

t[n+1,j]=

ut[1,j]

•M

irror:

ut[0,j]=

ut[1,j], u

t[n+1,j]=

ut[n,j]

•A

na

log

for j

Page 34: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

34

Co

mp

uter A

nim

atio

n 34

Ad

vertisemen

t

•S

om

me

rsem

este

r 200

5251-0

546

-00

: Ph

ysikalisch

-ba

sierte

S

imu

latio

n in

de

r Co

mp

ute

r Gra

ph

ik

•2V

1U

•Ü

bu

ng

= 1 S

em

este

rpro

jekt

in G

rup

pe

n

http://graphics.ethz.ch/~mattm

uel/teaching/projects2004/

Page 35: 14 computer animation - CGL @ ETHZ · – Solve partial differential equation on (regular) grid – Replace differentials by finite differences. 31 Computer Animation 31 Example:

35

Co

mp

uter A

nim

atio

n 35

Prü

fun

gsth

emen

0.

Intro

du

ction

wird

nich

tg

eprü

ft1.

Gra

ph

ics AP

Is2.

Co

lors

3.T

ran

sform

atio

ns

4.

Pro

jectio

ns

5.Lig

htin

g &

Sh

ad

ing

6.

Ra

ytracin

g7.

Te

xtu

re M

ap

pin

g8

.A

nti A

liasin

g9

.C

lipp

ing

Alg

orith

ms

10.S

can

Co

nve

rsion

11.G

rap

hics H

ard

wa

rekein

eP

rod

uktd

etails, ke

ine

Sh

ad

erbe

fehle

12.R

eal-tim

e Ren

derin

gP

ipelin

e op

timiza

tion

wird

nich

tg

ep

rüft

13.T

erra

in R

en

de

ring

wird

nich

tg

ep

rüft

14.

Co

mp

uter A

nim

atio

nw

irdn

icht

gep

rüft