DOC PREVIEW
UCSD CSE 169 - Cloth Simulation

This preview shows page 1-2-3-22-23-24-45-46-47 out of 47 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 47 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Cloth SimulationSlide 2Cloth Simulation with SpringsSlide 4ParticleEuler IntegrationPhysics SimulationSlide 8Uniform GravitySpring-DampersSpring-DamperSlide 12Slide 13Spring-Damper ForceSlide 15Slide 16Aerodynamic ForceSlide 18Slide 19Slide 20Slide 21Slide 22Slide 23Slide 24Slide 25Bending ForcesSlide 27CollisionsPlastic DeformationSlide 30Fracture & TearingRopes & SolidsSystem StabilityConservation of MomentumConservation of EnergySlide 36Slide 37Simulation StabilityIntegrationTwo-Level Integration MethodsMultipoint MethodsRunge-Kutta MethodsCloth StabilityAdvanced ClothContinuum MechanicsCollision Detection & ResponseSlide 47Cloth SimulationCSE169: Computer AnimationInstructor: Steve RotenbergUCSD, Winter 2005Cloth SimulationCloth simulation has been an important topic in computer animation since the early 1980’sIt has been extensively researched, and has reached a point where it is *basically* a solved problemToday, we will look at a very basic method of cloth simulation. It is relatively easy to implement and can achieve good results. It will also serve as an introduction to some more advanced cloth simulation topics.Cloth Simulation with SpringsWe will treat the cloth as a system of particles interconnected with spring-dampersEach spring-damper connects two particles, and generates a force based on their positions and velocitiesEach particle is also influenced by the force of gravityWith those three simple forces (gravity, spring, & damping), we form the foundation of the cloth systemThen, we can add some fancier forces such as aerodynamics, bending resistance, and collisions, plus additional features such as plastic deformation and tearingCloth Simulation• • ••••••••ParticleSpring-damperParticle•fam1vriffforcemomentummassmonaccelera tivelocityposition::::::fpavrvp mEuler IntegrationOnce we’ve computed all of the forces in the system, we can use Newton’s Second Law (f=ma) to compute the accelerationThen, we use the acceleration to advance the simulation forward by some time step Δt, using the simple Euler integration schemettnnnnnn111vrravvnnmfa1Physics SimulationGeneral Physics Simulation:1. Compute forces2. Integrate motion- RepeatCloth Simulation1. Compute ForcesFor each particle: Apply gravityFor each spring-damper: Compute & apply forcesFor each triangle: Compute & apply aerodynamic forces2. Integrate MotionFor each particle: Apply forward Euler integrationUniform Gravity 20008.90smmgravityggfSpring-Dampers••1r2r2v1vThe basic spring-damper connects two particles and has three constants defining its behaviorSpring constant: ksDamping factor: kdRest length: l0Spring-DamperA simple spring-damper class might look like:class SpringDamper {float SpringConstant,DampingFactor;float RestLength;Particle *P1,*P2;public:void ComputeForce();};Spring-DampersThe basic linear spring force in one dimension is:The linear damping force is:We can define a spring-damper by just adding the two: llkxkfssspring0 21vvkvkfdddamp   210vvkllkfdssdSpring-DampersTo compute the forces in 3D:Turn 3D distances & velocities into 1DCompute spring force in 1DTurn 1D force back into 3D forceSpring-Damper ForceWe start by computing the unit length vector e from r1 to r2We can compute the distance l between the two points in the process••1r2rll***12eeerreelSpring-DampersNext, we find the 1D velocities••1r2r2v1ve22ve v11ve vSpring-DampersNow, we can find the 1D force and map it back into 3D••efsdf1e   121210ffefsddssdfvvkllkf12ff Aerodynamic ForceIn the last lecture, we defined a simple aerodynamic drag force on an object as:ρ: density of the air (or water…)cd: coefficient of drag for the objecta: cross sectional area of the objecte: unit vector in the opposite direction of the velocityevf acdaero221vve Aerodynamic ForceToday we will extend that to a simple flat surfaceInstead of opposing the velocity, the force pushes against the normal of the surfaceNote: This is a major simplification of real aerodynamic interactions, but it’s a good place to startnvf acdaero221Aerodynamic ForceIn order to compute the aerodynamic forces, we need surfaces to apply it toWe will add some triangles to our cloth definition, where each triangle connects three particles1r2r3rAerodynamic ForceIn order to compute our force:we will need find the velocity, normal, and area of the triangle (we can assume that ρ and cd are constants)1r2r3rnvf acdaero221Aerodynamic ForceFor the velocity of the triangle, we can use the average of the three particle velocitiesWe actually want the relative velocity, so we will then subtract off the velocity of the air1v2v3v3321vvvvsurfaceairsurfacevvv surfacevAerodynamic ForceThe normal of the triangle is:1r2r3rn      13121312rrrrrrrrnAerodynamic ForceThe area of the triangle is:But we really want the cross-sectional area (the area exposed to the air flow)   1312021rrrr avnv 0aanvvAerodynamic ForceAs the final equation requires |v |2an, we can reduce the math a little bit:Also, notice that:    **2**21312nnnvvnvrrrrna22**nvnvAerodynamic ForceThe final aerodynamic force is assumed to apply to the entire triangleWe can turn this into a force on each particle by simply dividing by 3, and splitting the total force between themBending ForcesIf we arrange our cloth springs as they are in the picture, there will be nothing preventing the cloth from bendingThis may be find for simulating softer cloth, but for stiffer materials, we may want some resistance to bending• • •••••••Bending ForcesA simple solution is to add more springs, arranged in various configurations, such as the one in the pictureThe spring constants and damping factors of this layer might need to be tuned differently…• • •••••••CollisionsWe will talk about collision detection & response in the next lecture…In the mean time, here’s a very basic way to collide with a y=y0 planeIf(r.y < y0) {r.y= y0 - r.y;v.y= - elasticity * v.y;v.x= (1-friction) * v.x; // cheezyv.z=


View Full Document

UCSD CSE 169 - Cloth Simulation

Download Cloth Simulation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Cloth Simulation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Cloth Simulation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?