1
Kapitel 24:Animation
Computergrafik SS 2010
Oliver Vornberger
2
Animation
Key Frame Animation
Forward Kinematics
Inverse Kinematics
Particle Systems
Verhaltensanimation
3
Key frame Animation
4
Roboterarm
α
β
α'
β'
5
Forward Kinematics
α
µxy
¶360− α− βα
β
a
b
x = a · cos(α) + b · cos(α+ β)y = a · sin(α) + b · sin(α+ β)
a · cos(α)
b · cos(α+ β)
~x = f(Θ)
6
Skript für Forward Kinematics
Hüfte
Oberschenkel
Knie
Ferse
Fuß
Unterschenkel
7
Rotation in der Hüfte
8
Rotation im Knie
9
Rotation in der Ferse
10
Jurassic Park
geplant als Stop Motion Film
11
Jurassic Park
realisiert mit Dinosaur Input Device (DID)
R. Magid: "After Jurassic Park", American Cinematographer, December 1993.Abgedruckt in: Alan Watt "3D-Computergrafik", S. 549, Pearson Studium, ein Imprintvon Pearson EducationDeutschland GmbH, 2001.
12
Inverse Kinematics
α
β
α = tan−1(−b·sin(β)·x+(a+b·cos(β))·yb·sin(β)·y+(a+b·cos(β))·x )
µxy
¶
a
b
Θ = f−1(~x)
d
γ
d2 = a2 + b2 − 2ab cos(γ)d2 = x2 + y2
cos(γ) = a2+b2−x2−y2
2ab
β = cos−1(x2+y2−a2−b2
2·a·b )
y
x
13
Differenzierbarkeit
Θ
~x = f(Θ)
x
y = f(x)
∆f
∆x
f 0(x0) ≈ ∆f∆xf 0(x0) ·∆x ≈ ∆f
∆x ≈ ∆ff 0(x0)
x0
14
Jakobi-Matrix
Die Jakobi-Matrix einer differenzierbaren Abbildung
f : Rn → Rm
ist die m × n Matrix aller partiellen Ableitungen
Jf =∂f∂x =
⎛⎜⎜⎜⎜⎜⎜⎜⎝
∂f1∂x1
∂f1∂x2
· · · ∂f1∂xn∂f2∂x1
∂f2∂x2
· · · ∂f2∂xn
· · · · · · · · ·∂fm∂x1
∂fm∂x2
· · · ∂fm∂xn
⎞⎟⎟⎟⎟⎟⎟⎟⎠
15
Abhängigkeit zwischen dx und dΘ
Problem:
Aber: kleine Änderungen im Winkel verursachen kleine Änderungen in der Position
Θ = f−1(~x)
J(Θ) = ∂~x∂Θ
J(Θ)∂Θ = ∂~x
∂Θ = J−1(Θ)(∂~x)
16
Iterationsverfahren
Sei x die aktuelle PositionSei Θ der aktuelle Zustandsvektor
while (!fertig) {dx := kleine Bewegung Richtung ZielJ(Θ) = dx/dΘberechne Inverse von JdΘ := J-1(Θ)(dx)x := f(Θ+dΘ)
}
xdx
17
Particle Systems
Geeignet für
• Sand• Funken• Wasser• Schnee• Feuer• …
Simulation physikalischer Gesetzekeine Interaktion untereinander
18
Pioniere
• William Reeves [1983]:″Particle Systems - A Technique for Modeling a Class of Fuzzy Objects″ACM Transaction on GraphicsLucasFilm, Pixar (Luxor Jr.)
• Karl Sims [1990]:″Particle Animation and Rendering using Data
Parallel Computation″ACM Computer GraphicsConnection Machine CM-2, 65.536 Prozessoren
19
Partikeleigenschaften
• Position• Geschwindigkeit• Bewegungsrichtung• Lebenszeit• Größe• Farbe• Transparenz• Gestalt
20
Phasen
• Generierung neuer Partikel
• Zuordnung von Attributen
• Entfernen von Partikeln
• Transformation von Partikeln
• Rendern des neuen Frames
21
Physik
V 0 := V +A ·∆t
P 0 := P + V+V 02 ·∆t
A = g ·m0 · O−P|O−P |3
Position P, Geschwindigkeit V, Beschleunigung AMasse m0 im Zentrum O, Flächennormale NDämpfungsparameter d, Grenzgeschwindigkeit v0
V 0 := V − 2 · (V ·N) ·N
V 0 = V ·max(1− d∆t,min(1.0, v0|V |))
F = g·m0·m1r2
A = Fm
22
Particle Rendering
Für Head und Tail:• Position• Radius• Farbverlauf• Transparenz
Motion Blur berücksichtigen !
23
Particle Systems Demos
http://www.jhlabs.com/java/particles2.html
~cg/2008/skript/Applets/Particle/jhlabs.html
~cg/2008/skript/Applets/Particle/sims.html
~cg/2008/skript/Applets/Particle/kung.html
24white.sand © Alvy Ray Smith, Lucasfilm
Pflanzen
25
Verhaltensanimation
Simple Vehicle Model:• Masse• Position• Fahrtrichtung• Geschwindigkeit• Beschleunigung
Vehikel interagiert• mit Umweld• mit anderen Vehikeln
26
Pionier
• Craig W. Reynolds [1999]: Steering Behaviors for autonomous Characters[Sony Computer Entertainment]
http://www.red3d.com/cwr/steer
27
Seek & Flee
http://www.red3d.com/cwr/steer/SeekFlee.html
28
Pursuit & Evasion
http://www.red3d.com/cwr/steer/PursueEvade.html
29
Arrival
http://www.red3d.com/cwr/steer/Arrival.html
30
Obstacle Avoidance
http://www.red3d.com/cwr/steer/Obstacle.html
31
Path Following
http://www.red3d.com/cwr/steer/PathFollow.html
32
Queuing Behaviour at door
http://www.red3d.com/cwr/steer/Doorway.html
33
Schwarmverhalten
Separation Kohäsion Ausrichtung
34
Java Boids
http://www.red3d.com/cwr/boids/applet/
http://www.bekkoame.ne.jp/~ishmnn/java/boid3.html
35
Scanline Production GmbH, München
~cg/2010/skript/Applets/Particle/scanline.htm
Top Related