Transcript L07A_Forces

Forces - basic physics
Springs (Hooke’s law)
Damping
Gravity
Friction - static and kinetic
Viscosity
Rick Parent - CIS682
Basic Physics
f  ma
Accumulate forces,
calculate acceleration
f
a
m
v'  v  a * dt
Implicit assumption is
constant acceleration
over time slice
p'  p  v * dt
Rick Parent - CIS682
Integration
For arbitrary function, f
f (t  1)  f (t )  f ' (t ) * dt
We know the derivative
(acceleration). We need
to update the function
based on derivative
information
Accuracy v. time slice
Much mathematics about
how to update f based
on its derivative
– Runga-Kutta integration
– Implicit Euler
integration
– Etc.
Rick Parent - CIS682

Springs (Hooke’s law)
Spring’s rest length: exerts zero force
Fspring  kspring(x  x rest )
x
xrest
F
x
F
Rick Parent - CIS682
Spring Mesh
Edges => springs
Internal springs to stabilize shape
Rick Parent - CIS682
Damping
Calm down spring oscillations
Fdamping  kdampingv

F  (x  x rest )kspring  vkdamping
Rick Parent - CIS682
Mass-Spring-Damper System
Define point masses
postion
velocity
mass
force
fixed?
Define springs
point 1
point 2
rest length
kspring
kdamper
Multiple time samples per frame?
Rick Parent - CIS682
Mass-Spring-Damper System
For each point
Initialize force with wind
For each spring
Calculate spring-damper force
spring.point1.force += force
spring.point2.force -= force
For each point
acc = gravity
acc += mass/force
newVel = velocity + acc*dt
position += dt*(velocity+newVelocity)/2
velocity = newVelocity
Rick Parent - CIS682
Randomize
Controlled randomness adds more interest
To initial values (positions, velocities)
To force fields (wind direction, wind speed)
To spring constants, masses
To joint angles
Proximal joints: lower amplitude
Distal joints: higher amplitude
Coordinate frequence and phase
Rick Parent - CIS682
Angular Springs
1) Use dot product of normals (cosine)
2) Take inverse cosine and use angle
3) Place a linear spring between ends of triangles
Rick Parent - CIS682
Constrain Forces (soft constraints)
Create temporary restoring forces (springs) when constraint violated
F
F
F
Non-penetration
Fix to surface
Rick Parent - CIS682
Friction
Supporting object
Resting contact
Fs
F
FN
Normal force
Static friction
Fs  usFN

Rick Parent - CIS682
Friction
Supporting object
Resting contact
Fk
F
FN
Normal force
Static friction
Kinetic friction

v
Fs  usFN
Fk  uk FN
Rick Parent - CIS682
Gravity
Gm1m2
Fgravity 
r2
aobject 

F
mobject
Gmearth
2
2


32
ft
/s

9.8m
/s
rearth2

Rick Parent - CIS682

Viscosity
Fv  kv nv
kv - depends on shape of object
n - depends on properties of liquid
For spherical object:
kv  6r
Terminal velocity - viscosity and gravity balance
E.g., for sphere:

mg  6rnv
Rick Parent - CIS682