Modeling Cloth Using Mass Spring Systems

Similar documents
The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

The jello cube. Undeformed cube. Deformed cube

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Real Time Cloth Simulation

Cloth Simulation. COMP 768 Presentation Zhen Wei

Mass-Spring Systems. Last Time?

Physically Based Simulation

Physically Based Simulation

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

PHYSICALLY BASED ANIMATION

Cloth Animation with Collision Detection

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

CS 231. Deformation simulation (and faces)

3D Physics Engine for Elastic and Deformable Bodies. Liliya Kharevych and Rafi (Mohammad) Khan Advisor: David Mount

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

Cloth Simulations. 9.2 Physics - Cloth Simulations

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015

A Fast and Stable Approach for Restoration of Warped Document Images

Physically based modelling Computer Graphics I February 27, 2003

CS 231. Deformation simulation (and faces)

CLOTH - MODELING, DEFORMATION, AND SIMULATION

An Analysis of Interactive Deformable Solid Object Modeling

Cloth Hair. and. soft bodies

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Soft Body. 9.7 Physics - Soft Body

Cloth Simulation. Elaine Kieran (d ) Gavin Harrison (d ) Luke Openshaw (d ) MSc Computer Animation NCCA Bournemouth University

PSE Game Physics. Session (3) Springs, Ropes, Linear Momentum and Rotations. Oliver Meister, Roland Wittmann

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH

Physical simulation for animation

Cloth The Animation of Natural Phenomena Adrien Treuille

Numerical Integration

Interactive Real Time Cloth Simulation with Adaptive Level of Detail

Fundamentals of Computer Animation

Chapter 13 - Modifiers

Physics Tutorial 2: Numerical Integration Methods

14: MASS-SPRING SYSTEMS & CLOTH

Chapter 19- Object Physics

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

How To Implement a Pressure Soft Body Model

Announcements. Ray tracer is due in five days you should have started by now or you re going to have a bad week. Missing file posted on the web page

An Educational Rigid-Body Dynamics Physics Engine TJHSST Senior Research Project Proposal Computer Systems Lab

Fracture & Tetrahedral Models

Simulation of curly hair

Navier-Stokes & Flow Simulation

Chapter 6 Visualization Techniques for Vector Fields

GPU Computing: Particle Simulation

BOURNEMOUTH UNIVERSITY INTERACTIVE TOOL FOR CLOTH SIMULATION VOLHA KOLCHYNA. MSc Computer Animation and Visual Effects

Dressing Virtual People

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

Last Time? Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

2.11 Particle Systems

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Particle Systems. Lecture 8 Taku Komura

Computer Simulation of Prostate Surgery

Particle Systems. g(x,t) x. Reading. Particle in a flow field. What are particle systems? CSE 457 Winter 2014

Virtual Environments

Chapter 14 Particle Systems & Interactions

Animation. Itinerary. What is Animation? What is Animation? Animation Methods. Modeling vs. Animation Computer Graphics Lecture 22

THE development of stable, robust and fast methods that

A New Self-Collision Detection Method for Cloth Simulation

4 Visualization and. Approximation

Animation. Itinerary Computer Graphics Lecture 22

Comparing Efficiency of Integration Methods for Cloth Simulation

Discrete Element Method

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

A Virtual Garment Design and Simulation System

Pre-Step and Post-Step Deformation Schemes for Fastening Band-Shaped Twisted Cloth

Particle Systems. Sample Particle System. What is a particle system? Types of Particle Systems. Stateless Particle System

Soft-Object Modelling Using A Chainmail Algorithm Matt Dean Computing 2003/2004

Rigid Body Dynamics, Collision Response, & Deformation

Could a skydiver, whose parachute failed to open, hit one side of a playground seesaw and send

Interactive design and simulation of net sculptures

Cloth Simulation on GPU

Integrating Physics into a Modern Game Engine. Object Collision. Various types of collision for an object:

Shape of Things to Come: Next-Gen Physics Deep Dive

Intuitive Control of Dynamic Simulation Using Improved Implicit Constraint Enforcement

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

GPGPU in Film Production. Laurence Emms Pixar Animation Studios

Development of the Compliant Mooring Line Model for FLOW-3D

Techniques for Animating Cloth

Co-rotational Finite Element Solid Simulation with Collisions. Patrick Riordan

Anatomy of a Physics Engine. Erwin Coumans

Directional Constraint Enforcement for Fast Cloth Simulation

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time

animation computer graphics animation 2009 fabio pellacini 1

Verification and Validation for Seismic Wave Propagation Problems

Fig [1] Fig v =...[4]

QP-Collide: A New Approach to Collision Treatment

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Mid-Year Report. Discontinuous Galerkin Euler Equation Solver. Friday, December 14, Andrey Andreyev. Advisor: Dr.

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

Chapter 9 Animation System

Tutorial: Getting Started with the LabVIEW Simulation Module

Explicit and Implicit Coupling Strategies for Overset Grids. Jörg Brunswig, Manuel Manzke, Thomas Rung

To build shapes from scratch, use the tools are the far right of the top tool bar. These

Real-time Rendering of Soap Bubbles Taking into Account Light Interference

Analysis of Fluid-Structure Interaction Effects of Liquid-Filled Container under Drop Testing

Transcription:

Modeling Cloth Using Mass Spring Systems Corey O Connor Keith Stevens May 2, 2003 Abstract We set out to model cloth using a connected mesh of springs and point masses. After successfully implementing our simulation in C++ and OpenGL, we analyzed it to determine how realistically the model responded to various situations, including collisions with objects and external forces like wind. We conclude that our system does model realistic cloth in most situations. For extreme values of the spring constant k our simulation fails. For small k, objects can pass through the cloth. For large k, our fixed step size fourth order Runge-Kutta approximation is no longer stable. 1 Introduction As the horsepower of the average personal computer increases, the gaming world has turned to more and more realistic simulations of the real world. Games are now expected to realistically model all aspects of the world and provide users with an interactive environment which reacts realistically to other elements in that environment. One big challenge is to realistically model clothing and other cloth-like materials such as curtains. This is a problem which has been solved many different ways to varying degrees of realism. Some implementations simply ignore the problem and just texture map the characters with images of clothing. While this is a quick and easy solution, the results are not terribly realistic, as the clothing will not respond realistically to the movement of the character. In fact, the clothing will be completely static and gives the impression of being painted on the character. 1

Many models use a system of springs to model cloth. They set up a mesh of individual vertices connected with many springs, and then use the equations for spring dynamics to model a piece of cloth. This solution provides a more realistic model, but requires a lot more computation than the texture mapping model. Not only must the system compute the forces acting on each vertex, but the system must also provide collision detection for each vertex, to make the cloth interact with other objects and itself in a realistic manner. Thus, modeling cloth becomes a trade-off between speed and realism. 2 Questions In real life, cloth is made out of thousands of fibers of varying materials woven together in various patterns. We want to create a simulation using only point masses and springs. Thus, our first question is: Can we make a real time simulation of cloth using a mass spring system? Once we have implemented a simulation, we want to determine whether or not that simulation behaves in a manner consistent with real cloth. Which leads us to the second question: Does our model behave realistically? Does it respond properly to collisions with objects, and with any external forces that are applied? We will then explore our model quantitatively to get an idea how well our approach can simulate the wide variety of materials allowed for in the mass spring system. Thus our last question is: For what values of the spring constant k is our model no longer valid? 3 Our Model The cloth is defined by a mesh of point masses. These point masses are connected together using three different sets of springs (see figure). Structural Springs These springs connect the mesh in a rectangular grid. They provide the structural basis for our cloth. Shear Springs To provide a resistance force to shearing, these springs connect the points diagonally. 2

Bend Springs To provide resistance to the cloth simply folding in on itself these springs are connected between every other point (see figure). Bend Springs Structural Springs Sheer Springs The equations that govern our model are fairly simple. The acceleration of each mass is determined by the standard equation for force: Ftotal = m a. For each mass the total force is the sum of the force due to each spring given by Hook s law (F = k l) and of any damping and external forces. Where k is the spring constant and l is the displacement of the spring from it s original length. Using the standard equations for position and velocity, we set up our model with the following system of equations: d x = v(t) dt d 2 x F = total ( x) dt 2 m F total = (k l) v(t) d + F external 3

F total is the total force acting on a point of mass m at position x with velocity v. k is the spring constant and l is the displacement of the spring from it s original length. d is a damping coefficient. 4 Numerical Methods Using a simple first order Euler approximation, our system becomes: x i+1 = x i + v i t v i+1 = v i + F i m t where x i is the position at time i and v i is the velocity at time i. We discovered that Euler s method became very unstable quickly in our simulation. Thus, we decided to use an implicit method of approximation. For each step in the simulation we apply fourth-order Runge-Kutta to calculate the state of the cloth after a given time-step h. Fourth-order Runge- Kutta applied to the cloth model takes this form: (v 1, a 1 ) = h f(t, p t, v t ) (v 2, a 2 ) = h f(t + 1 2 h, p t + 1 2 v 1, v t + 1 2 a 1) (v 3, a 3 ) = h f(t + 1 2 h, p t + 1 2 v 2, v t + 1 2 a 2) (v 4, a 4 ) = h f(t + h, p t + v 3, v t + a 3 ) (p t+h, v t+h ) = (p t, v t ) + 1 6 (v 1, a 1 ) + 1 3 (v 2, a 2 ) + 1 3 (v 3, a 3 ) + 1 6 (v 4, a 4 ) 5 Conclusions Our model provides a simple yet effective method for realistic modeling of cloth in real time. The simulation looks realistic and collides with objects consistent with the way real cloth would. When an external force like wind is added, the system continues to react in a very realistic manner. The model even simulates the waves that are created by holding one point of a cloth and shaking it back and forth. 4

We did find that for values of k less than or equal to 1, collision with a sphere failed. This is because our model only checks collisions with the points, and not with the region bounded by the point. Thus, when the cloth falls onto a sphere, the springs can stretch far enough that the sphere will simply pass right through the cloth. This is not realistic behavior. For reasonable values of k the model collides correctly as long as the objects are larger than the spacing between nodes. For values of k greater than 22, the system becomes unstable even using fourth-order Runge-Kutta indicating a different integration method is required in those situations. 6 Extensions and Future Work Our simulation is fairly simple and straight forward. It provides an effective means of simulating cloth. However there is still room for improvement. For instance, we would like to add collision with the cloth itself, not just the points. This would prevent the problem of objects passing through very elastic cloth. Also, we could add collision between the cloth and itself. Currently, the simulation does not check to make sure the cloth hasn t penetrated through itself. This can lead to some problems when the cloth wraps around an object and passes through itself. Unfortunately, this is a rather difficult problem to solve. Finally, to prevent the model from exploding on large values of k, we could implement a different integration method. Perhaps a variable step size Runge-Kutta would be more stable. Alternatively, a method which is specifically designed for stiff equations would also be a helpful extension of the simulation. 5

7 References http://www.cs.lth.se/~calle/report.pdf http://mathworld.wolfram.com/runge-kuttamethod.html http://www.gamasutra.com/features/20000327/lander_pfv.htm 6