Download presentation
Presentation is loading. Please wait.
1
Comp259 / Spring 2002 Samir Naik 2/6/02
Cloth Simulation Comp259 / Spring 2002 Samir Naik 2/6/02
2
Overview Applications of cloth Cloth Modeling
Cloth Dynamics and Simulation Demos
3
Applications of cloth Movies, games, VR.
Try to find a room without cloth! We can usually just texture map static objects Try to find a person not wearing clothes! Texture mapping clothes doesn’t look good on animated characters Need to simulate movement of the cloth
4
Motivation Texture mapped clothes vs. simulated
5
Cloth Modeling D.E. Breen, D.H. House and M.J. Wozny, “Predicting the Drape of Woven Cloth Using Interacting Particles,” SIGGRAPH '94 Conference Proceedings, (Orlando, FL, July 1994) pp Getting the final configuration (drape) of cloth to look right. Static, not dynamic modeling. What would this shirt look like made from cotton rather than silk? Would this dress have a more pleasing drape if made from silk rather than light wool?
6
Cloth Modeling Example of draping cloth over objects
7
Particle-based model Cloth fibers and crossings
Approximated by mass-spring particle system.
8
Particle-based model
9
Particle-based model Categorizing thread motion Energy equation
Thread collision Thread stretching Out-of-plane bending Trellising (shearing) Energy equation Ui = Urepel i + Ustretch i + Ubend i + Utrellis i + Ugrav i
10
Energy equation Energy equation
Ui = Urepel i + Ustretch i + Ubend i + Utrellis i + Ugrav I Urepel. Artifical repulsion energy, keeps particles a minimum distance apart. Simple approach to collision detection. Ustretch. Energy of tensile strain between each particle and it’s 4 neighbors Ubend. Energy due to out of plane bending. Utrellis. Energy due to bending around a thread crossing. Ugrav. Potential energy due to gravity.
11
Repel and stretch
12
{ { Repel and Stretch Repel forces Stretch forces rij rij> rij
{ rij> rij { rij>
13
Repel and stretch Repel and stretch energy function are stiff since most cloth doesn’t deform too much.
14
Energy equations Repel and stretch equations are about the same for all types of cloth Can derive equations from trial and error Bend/shear equations are different for different types of cloth (wool, cotton, etc). Changes. Derive equations from empirical mechanical data.
15
Kawabata system Physically measuring cloth properties.
Approximate actual cloth energy functions with simpler functions. Use piecewise linear and quadratic polynomials that interpolate inflection points of real curve
16
Bending equation
17
Bending For each particle i, Mi is the set containing 6 ij angles i1
18
Bending Bend energy equation comes from measurement
19
Bending Bend energy in one direction
20
Trellising (shearing)
21
Trellising(shearing)
Trellising energy equation also comes from measurment
22
Trellising (shearing)
Shear in one direction
23
Results
24
Results
25
Cloth Dynamics Breen wanted cloth to look good in static poses
Time step could be very small because simulation time was done off line VR/games want cloth to look good when a user is interacting with it. Need simulation to be real time, so we need larger time steps (dt >.03 sec)
26
Integration Purpose of integration
Given the known position x(to) and velocity v(to) at time to Find a new position x(t0+h) and velocity v(to+h) at time t0+h
27
Explicit integration Forward Euler’s method
Based solely on conditions at to Takes no notice of wildly changing derivatives and proceeds forward blindly
28
Explicit integration BAD! Step size must be really small or simulation will blow up. Could use RK4 Better smoothing function Force is sampled more times during time step. A little more stable, but still has same problems Collisions introduce discontinuties, and RK4 doesn’t like discontinuities.
29
Explicit integration DEMO - when things blow up Clothy by Jeff Lander
30
Implicit integration Backwards Euler method
31
Backwards Euler Start from output state (x0+dx, v0+dv) and use a forwards Euler step to run the system backward in time. i.e. taking the step -h(v(t0+h), f(x(t0+h),v(t0+h))) brings you back to (x0,v0) Forces an output state whose derivative at least points back to where you came from. Sanity checking!
32
Backwards Euler We still consider forces to be constant within time step But now output state will have consistent forces that will not give rise to instabilities
33
Backwards Euler We must compute f (x0+dx, v0+dv)
To avoid iteration do a first order approximation Substituting this in we get
34
Backwards Euler Grouping all v terms together Solve for v and x
35
Baraff/Witkin David Baraff, Andrew Witkin, “Large Steps in Cloth Simulation,” SIGGRAPH '98 Conference Proceedings, (Orlando, FL, July 1998) pp
36
Cloth Energy Breen describes cloth behavior as energy U, which was to be minimized Baraff describes behavior in terms of a grid of conditions can be simple: C(x) = |x - | or more complicated: Cij(x) = we want C(x) == 0
37
Forces Energy function k is a stiffness constant Force function
38
Force derivatives Need force derivatives for backwards Euler
With respect to x K is a sparse matrix With respect to y Since C(x) doesn’t depend on v, the matrix f/v is zero
39
Stretch/compresson Particles have fixed plane coordinate (ui,vi)
w(u,v) is a linear function over each triangle maps from plane to world space Stretch can be measured by examining derivatives wu= w/u wv= w/v
40
Stretch/compression What is this function “w”?
Approximate as a linear function over triangle x1 x2 World coords (u1, v1) Plane coords (u2, v2)
41
Stretch/compression Condition for stretch energy
a is area of triangle in uv (plane) coords bu and bv are usually 1, but can be changed to lengthen and widen certain parts of cloth i.e. the cuff on a shirt sleeve
42
Shear and bend forces Inner product should be minimized wv wu = 0 != 0
43
Damping Damping should only occur in direction of systems velocity
This looks similar to our force equation
44
Derivative of damping force
With respect to x drop term for symmetry’s sake With respect to v
45
Mass Modification Tricky way to constrain points
Make mass infinity. It won’t move! We actually have a 3x3 inverse mass matrix so mass is actually a vector can constrain motion in each axis separately e.g. no acceleration in z axis
46
Results
47
Verlet Integration Implicit Velocity-less Update step
store current position x and prev position x* Update step x = x-x* + ah2 = x-x* + h2(f0/M)
48
Verlet integration Update step x-x* is approximate velocity
x = x-x* + h2(f0/M) x-x* is approximate velocity Since velocity is implicitly given, it is hard for velocity and position to come out of sync. Damping x = .99(x-x*) + h2(f0/M)
49
Verlet cloth Thomas Jakobsen, “Advanced Character Physics”, GDC 2001
Simplify everything by constraining particles by rods not springs At each iteration, rod goes back to it’s rest length Solve by local iteration Each constraint tries to satisfy itself, let the other constraints worry about themselves
50
Verlet cloth Pros Cons fast stable not physically based
loss of energy in system can’t minimize bending/shearing easily
51
Verlet cloth Demo
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.