Title: Flexible Objects
1 Flexible Objects
Abdennour El Rhalibi
2Flexible Objects Elastic and inelastic behavior,
viscoelasticity, plasticity, fracture
Elastically Deformable Models Terzopoulos et
al SIGGRAPH 87
3Modeling Inelastic Deformation Viscoelasticity,
Plasticity, Fracture Terzopoulos and
Fleiseher SIGGRAPH 88
4Graphical Modeling and Animation of Brittle
Fracture OBrien and Hodgins SIGGRAPH 99
Simulation of Object and Human Skin Deformations
in a Grasping Task Gourred et al SIGGRAPH 89
5Graphical Modeling and Animation of Ductile
Fracture OBrien et al SIGGRAPH 02
http//www.cs.berkeley.edu/job/Projects/Fracture/
fracture.html
6Spring-Mass Systems
- Model objects as systems of springs and masses
- The springs exert forces, and you control them by
changing their rest length - A reasonable, but simple, physical model for
muscles - Advantage Good looking motion when it works
- Disadvantage Expensive and hard to control
7Flexible Objects ? SPRING-MASS SYSTEMS The
simplest, most common approach
Straightforward strategy
Point Mass
Spring (rest length edge length)
External Forces (collisions, gravity, wind, )
8Spring mass fish
Due to Xiaoyuan Tu, http//www.dgp.toronto.edu/peo
ple/tu
9Spring mass fish
http//www.dgp.toronto.edu/tu/animations.html
10Strings
- A whole line of points attached together with
springs - Simple to model, great for making realistic
straps of bullets for chain guns, tails on
animals, bungie ropes. - The springs have a normal length of, say, one
unit. - If the adjacent points move further than one unit
of length apart, they experience a force towards
each other proportional to the extension of the
spring that connects them. - Likewise, if they move closer than one unit
apart, they experience a force pushing them
apart.
11Strings
- Two ways to model the force on the points
- With mass ? If you are creating animations
- Without mass ? If you are just trying to find the
optimum shape of a string hanging over a certain
object
Forces between Two Springs
12Strings without Mass Forces affect the position
of the point
i
Normal length
Small amount (0.01 or so) makes the string move
slowly
gravity
13Strings with Mass Forces affect the velocity of
the point
i
- If you make a string like this, you will notice
that it is extremely flexible. - To make it stiffer, you can compare each point
with its 4 or even 6 closest neighbors, instead
of 2.
Damping (between about 0.95 and 0.99), is the
energy loss from the string. If you set it to 1,
then the string will never stop swinging around,
and setting it to more than 1 will make the
string increase its swing by itself and
eventually fly off the screen.
14Cloths
- Simply a whole load of interwoven strings!
- We need to add an extra dimension to our string
routine. - Imagine a cloth to be a sheet of points all
connected together by springs. - If two points get pulled further apart, then they
experience a force pulling them together and vice
versa. - This very simple model of a cloth is reasonably
accurate!
15Cloth Behavior
If you compare each point with its 4 nearest
neighbors ? a fisherman's net.
If you compare each point with its 8 nearest
neighbors ? a very flexible cloth
If you compare each point with its 24 nearest
neighbors ? a more realistic, stiffer cloth,
though it's much slower to compute
16Massless Cloths
- Every point on the cloth moves at a rate
proportional to the sum of the forces acting on
it from the neighboring points. - Create a 2-dimensional array of co-ordinates to
hold the x, y and z positions of the cloth in
space. - Initialize the values of cloth(p,q) to (p,q,0).
- We will need two of these arrays. One to hold the
current state of the cloth, and the other to hold
the new cloth that is being calculated. - When we have finished calculating the cloth, copy
all the values from our second array back to the
first.
17cloth1 (0 to 31, 0 to 31) cloth2 (0 to 31, 0 to
31) Variables VECTOR MovementVector VECTOR
SpringVector VECTOR ForceVector VECTOR Gravity
(initialised to (0, 0, g) where g is gravity,
0.02 is a good number) REAL Length REAL
ForceScaler REAL NormalLength
18For every point (p,q) on the cloth
MovementVector Gravity For each of the
24 neighboring points SpringVector
(position in space of neighbour) - (position in
space of point (p,q)) Length length
of SpringVector NormalLength The
length SpringVector would be if the cloth were
unstretched ForceScaler (Length -
NormalLength) / NormalLength
SpringVector SpringVector (1/Length)
ForceVector SpringVector ForceScaler
ForceVector ForceVector SmallAmount
add ForceVector to MovementVector
end of loop Add MovementVector to
cloth1(p,q) and store it in cloth2(p,q)
make sure this point does not move inside an
object end of loop Copy all the values in
cloth2 to cloth1 keep doing all this forever
19Cloth Interacting with Objects
- We will need some objects for the cloth to
interact with. - The simplest is a floor.
- Check each point on the cloth to see if it is
below the floor, and if it is, then move it to
the surface. - It is quite easy to make a sphere for the cloth
to fall over! - Check each point to see if it is inside the
sphere. - If it is, then move it to the nearest point on
the surface of the sphere.
20Cloth with Sphere
REAL Distance Distance distance from the
point(p,q) to the center of the sphere if
Distance lt (radius of sphere) then
ForceVector (position of point in space) -
(center of sphere) ForceVector
Forcevector / Distance radius point(p,q)
(center of sphere) ForceVector end if
21Adding Wind
- Adding wind to the cloth allows us to simulate
the fluttering of flags and other clothwind kind
of situations. - This model is not totally accurate.
- The wind affects the cloth, but the cloth does
not affect the wind, to do this would require a
vast amount of fluid dynamic calculation. - However, it produces reasonable looking
fluttering effects. - For this we will need to be modeling cloth with
mass.
22Adding Wind
- First the cloth must be broken down into
triangles. - This is easy to do, since the cloth is already
described as an array of points. -
- The effect of the wind on the cloth is calculated
on each of these triangles individually. - At each point of the cloth, the sum of the effect
of the wind on the surrounding triangles is
calculated.
23Adding Wind
- The force acting on a triangle due to air
molecules bouncing off it will always be in the
direction of the normal vector of that triangle. - The normal vector for each triangle will
obviously have to be calculated every frame
because it will be constantly changing.
24Adding Wind
- The force will be proportional to
- the surface area of the triangle,
- the angle at which the wind hits the triangle,
- and the speed of the wind.
- When we use the Cross Product to calculate the
normal vector of the triangle, the length of that
vector is proportional to the area of the
triangle, which makes things a little simpler.
25VECTOR force VECTOR normal VECTOR wind set
force vector to (0,0,0) on all points on
cloth loop through all triangles force
unitvector(normal) dotproduct(normal, wind)
add force to all points making up this triangle
end of loop loop through all points on
cloth add gravity to force add force
to velocity end of loop -- rest of cloth
routine --