Interactive Real Time Cloth Simulation with Adaptive Level of Detail

Size: px
Start display at page:

Download "Interactive Real Time Cloth Simulation with Adaptive Level of Detail"

Transcription

1 Interactive Real Time Cloth Simulation with Adaptive Level of Detail Olof Häggström February 5, 2009 Master s Thesis in Engineering Physics, 30 credits Supervisor at EA-DICE: Joakim Lord and Torbjörn Söderman Examiner: Martin Servin Umeå University Department of Physics SE UMEÅ SWEDEN

2

3 Abstract When simulating physics for computer games much effort is put into making the simulation run fast and stable without losing the visual performance. This thesis present a way of simulating many cloth objects on screen with a total cpu-time of 1ms per frame at 30hz. The core simulation is position based, the positions of the particles are constrained, and the mesh has the ability to change its level of detail making the simulation run much faster when many objects are visible. This method can be extended to arbitrary triangle meshes but here only rectangular meshes are used. Despite that little effort has been put into conservation of physical properties such as energy and momentum the output from the simulation is highly convincing. The work was done at EA Digital Illusion CE and the method met their demands for simulating cloth in their inhouse game engine.

4 ii

5 Contents 1 Introduction Simulating Physics Physics in computer games Different aspects of cloth Problem Description 5 3 Theory Newton s laws and numerical integration Equation of motion Steppers and integrators Methods for simulating cloth Particle System Springs Constraints Jacobsen s method Verlet stepper Choosing a suitable method Motivation Position based dynamics Derivation, position projection and constraints Implementation Core Simulation Damping Air resistance Level of detail Attaching the cloth iii

6 iv CONTENTS 6 Result Visual Computational Conclusions Limitations and future work Acknowledgements 35 References 37 A Advanced damping 39 B Figures 41

7 List of Figures 3.1 The position in t 2 is wrongly approximated when using the velocity at t 1 ; the particles position differs from the real path and the error i labeled e Particles in a regular order Structure springs connecting particles in horizontal and vertical direction Shear springs connecting particles to their neighbors on the diagonals The bending springs but illustrated as lines Hookes Law Projection of particle on constraintsurface described by a distanceconstraint between the particles a and b Two triangles adjacent to each other, masspoints are numbered and normals face in the oposite direction The same triangles as in fig.(4.7) seen from another angle showing the angle between the triangles normals One triangle with its nodes p 1 p 3, normal n, velocity v and external wind w Small grid with two lod-levels where the black nodes are coarse grid The eight flags that are used in the timing in fig.(6.2) Different number of sheets of cloth at different lod levels plotted against simulation time [ms] B.1 Bars showing how different parts of the simulation is distributed over total simulation time per frame at different LoD levels v

8 vi LIST OF FIGURES

9 List of Tables vii

10 viii LIST OF TABLES

11 Chapter 1 Introduction 1.1 Simulating Physics Even the most complex system can be described by differential equations and by solving these equations, given some initial conditions, the function describing the movement of the system can be used to get the systems positions at every given time. The problem is that far from all differential equations can be solved analytically. One of the most simple systems, the pendulum, can only be solved analytically for initial angles small enough for the small angle approximation sin(x) = x to be valid. And even this system s analytical solution fails to be valid if something alters the movement, like an impulse from something colliding with the pendulum. So this is one of the main reasons why the dynamics of a physical system has to be simulated and cannot be described by the analytical solutions to the system which, as stated before, seldom exists. 1.2 Physics in computer games The computer game Spacewar from 1962 is often described as the first computer game ever. This simple game consists of two player controlled spaceships that moves around a central star. Bullets and the ships are pulled towards the stars so this first game had some simulation running controlling this gravitational field produced by the star. From the age of Spacewar and up to today physics in a computer game has gone through a tremendous change, the game Quake (1996) was the fist game ever to use real 3D-models 1

12 2 Chapter 1. Introduction and from there the evolution has boomed into where we are today. A computer games visuals and gameplay is today much dependent on the physics simulation; the dynamics of characters, vehicles, smoke, water, etc. is today most commonly controlled by a physics engine 1. One of the main reasons is that the experience of the computer game is enhanced if the game feels and looks as if it is a real world. Take for instance a flag, one can animate a flag based on the pattern from an off line simulation and get perfectly realistic movement but the movement has to, at some point, repeat itself and therefor a repetitive pattern can be spotted. Interaction with the environment is also difficult to achieve with an animation, if the flag is attached to a vehicle is hard to animate especially if the car is controlled by the player making the movement impossible to predict. I will not state that it is impossible to animate movement of cloth only that it can be a hard and timeconsuming work. By simulating, in this case the flag in real time, the user can get accurate feedback directly from her or his actions and this enhances the overall experience of the game. The same goes for everything else in a game so the game companies tries to simulate as much as possible, making the game look and feel more realistic. Of course there is a limitation in CPU and memory so what and what s not simulated has to be carefully chosen. 1.3 Different aspects of cloth Cloth is as hard to simulate as it is easy to know what is expected of the simulations visual output. Through the history of mathematically describing the dynamics of cloth a quite important question has been asked; Is cloth a mechanical material with mechanical interaction between threads or a continuous material, as metal, but with low resistance to bending? [2] Everyone has come in contact with cloth; we wear it all the time without thinking about these things. The thing is that the more one studies the dynamics of cloth the more one understands the complexity. A lot of people has, since the dawn of computer animation and physics simulation, tried to described the dynamics of cloth and for an extensive overview i suggest the book 1 A physics engine is a computer program that simulates Newtonian physics models, using variables such as mass, velocity, friction and wind resistance. It can simulate and predict effects under different conditions that would approximate what happens in real life or in a fantasy world. Its main uses are in scientific simulation and in video games.-wikipedia, the free encyclopedia-

13 1.3. Different aspects of cloth 3 Cloth Modeling and Animation [2], where the authors has collected many references to articles about cloth written up until the year 2000.

14 4 Chapter 1. Introduction

15 Chapter 2 Problem Description Simulating cloth, likely to occur in a Battlefield game is the core statement given by DICE prior to the start of this project. Speed is important and the CPU budget is 1ms per frame making it important to have dynamic level of detail (lod) enabling the number of simulation nodes to decrease with distance from the camera. DICE does not currently use simulated cloth in their Battlefield games so the purpose of this thesis project is to make a cloth simulation that is fast enough to make it into the Frostbite game engine. The visual result has to be convincing for the player without breaking the CPU-budget and this will certainly make the physics less accurate but again as long as the visual result is convincing, the accuracy on the actual physics is less important. The implementation will be done in the Frostbite Engine 1. 1 Inhouse game engine written from ground up at EA Digital Illusion CE (DICE). 5

16 6 Chapter 2. Problem Description

17 Chapter 3 Theory First some notations that are used throughout this work, x is the positions of the particles p is the estimates for the new positions v is the velocities C is the set of constraints for the system t timestep F ext external force m mass w = 1 m k d some damping for the velocities 3.1 Newton s laws and numerical integration To be able to understand even the most basic theory in cloth simulation one has to remember some basic laws of physics and a little about of numerical integration. It s assumed that the reader has basic skills in calculus and linear algebra, still the explanations and arguments is made as simple as possible. 7

18 8 Chapter 3. Theory Equation of motion Newton s second law states that the acceleration a on an mass point is proportional to the sum of all external forces acting on it. Since the acceleration is the second timederivative of the position Newton s second law can be written as, F tot = m d2 dt 2 x (3.1) Where m is the mass of the object and x is the position. From here on the time derivative on x will be denoted ẋ so the relation, eq.(3.1) can be written as F tot = mẋ and, if all the external forces are known, it can be used to calculate the change in position Steppers and integrators What follows is a brief description of, and short comment on, some of the numerical integrators considered for this project. The derivations and discussions are quite short so for a thorough analysis around the stability for different steppers i strongly suggest Claude Lacoursières Phd. thesis Ghosts and machines: regularized variational methods for interactive simulations of multibodies with dry frictional contacts [4]. Explicit Eq.(3.1) is a second order differential equation and can be split up into a system of first order equation, v = F m (3.2) v = ẋ (3.3) By approximating these derivatives with v = v n+1 v n t + O( t 2 ) (3.4) ẋ = x n+1 x n t + O( t 2 ) (3.5)

19 3.1. Newton s laws and numerical integration 9 The system can be written as v n+1 = v n + t F (x n, v n ) m (3.6) x n+1 = x n + tv n (3.7) And this is the explicit Euler stepper, given a force (F ), time step ( t) and initial conditions at time n the new velocities and positions at time n + 1 can be calculated. This stepper is the easiest there is and of course this comes with some drawbacks. The main issue with explicit steppers are that they are not stable, using the velocity and position at one timestep to approximate the state in the next step accumulate the error term and finally the system will explode. p e real path time t 1 t 2 Figure 3.1: The position in t 2 is wrongly approximated when using the velocity at t 1 ; the particles position differs from the real path and the error i labeled e. Simply by using the velocity at time n + 1 when updating positions we get a stepper known as symplectic Euler or Leapfrog. v n+1 = v n + t F (x n, v n ) m (3.8)

20 10 Chapter 3. Theory x n+1 = x n + tv n+1 (3.9) This method is as easy to use as the explicit Euler but conserves energy much better. Implicit Until now the previous steppers has predicted the next step using only information in the current step. To get more stable simulations we can use an implicit stepper v n+1 = v n + t F (x n+1) m (3.10) x n+1 = x n + tv n+1 (3.11) This stepper uses information about the state in the next time step, and since we don t have that information yet we have to form a system of algebraic equation. Note that the velocities in the function describing the force has been removed since this implicit method will introduce a lot of numerical damping and also for simplicity. The unknowns in this system is what we want namely the velocities and positions in the coming time step. From here we can assemble and solve matrix system for all the equations.

21 Chapter 4 Methods for simulating cloth 4.1 Particle System Figure 4.1: Particles in a regular order This, fig.(4.1), is the basic setup for simulating a rectangular piece of cloth. Masspoints are evenly distributed over a rectangular area and are then kept in place by either constraints or springs. Two different methods are discusses and one of them where chosen due to stability and other properties discussed later Springs The most straightforward way of simulating a piece of cloth is to build a grid consisting of mass points fig.(4.1) and springs. The masses are connected with mass less springs in 11

22 12 Chapter 4. Methods for simulating cloth different ways and what follows is a description of these different springs. The different springs have different primary functions but they all contribute to govern how much the cloth will stretch. Structural springs These springs fig.(4.2) primary task is to keep the structure of the cloth, they connect particles with neighboring particles in the horizontal and vertical direction. Figure 4.2: Structure springs connecting particles in horizontal and vertical direction Shear springs The shear springs fig.(4.3) are there to keep the cloth from, as the name implies, shear. These springs connect a pointmass to the neighbors on the diagonal. Figure 4.3: Shear springs connecting particles to their neighbors on the diagonals

23 4.1. Particle System 13 Bending springs The final set of springs is called bending springs fig.(4.4) and these springs connect each point mass with masses in the horizontal and vertical direction skipping the closest one. The bending springs keeps the cloth from bending so without these springs the cloth would be able to fold, without resistance, over the vertical and horizontal direction. Figure 4.4: The bending springs but illustrated as lines Hooke s law Hooke s law, eq.(4.1), states that the force from a spring is proportional to the spring s deviation from its rest length. F spring = k(x 0 x) (4.1) The value k is the spring constant which governs how large the force will be relative the elongation of the spring. This model can be extended to account for damping. The damping is relative the derivative of the elongation of the spring hence the velocity of the point mass. Force from a spring can, in one dimension, be rewritten as F spring = k s (x 0 x) k d v, (4.2) where the term k d v is the damping proportional to the velocity. This is only valid in scalar or one dimensional form. So by introducing vector-notation the equation describing the force from a spring can be written as

24 14 Chapter 4. Methods for simulating cloth k x 0 x Figure 4.5: Hookes Law [ ] v ab x ab xab F ab = k s ( x ab x 0 ) + k d x ab x ab (4.3) Here the subscript denotes the force, distance and velocity relative two particles, a and b, connected by a spring. Note that the force from a to b is the same, in magnitude, as the force from b to a but its direction is inverted. This property comes from Newton s third law that states that from every action there is an equal and opposite reaction. Force By using Hooke s law the force from each spring on each particle can be calculated, the calculations are simplified by using Newtons third law. When all the forces from the springs are calculated the component from the gravity, contacts and air resistance are applied. (More about air resistance later) If all forces are known the system can be stepped forward in time using a stepper/integrator of choice. Note that the explicit stepper will not work here since the dynamics from the springs will give oscillating movement between the particles, fig.(3.1).

25 4.2. Jacobsen s method Constraints The particles in fig.(4.1) can be kept in place by constraints in the same way as with the springs. A constraint is basically a condition that must be satisfied, here the constraints are distances between particles of angles between adjacent triangles in a mesh. 4.2 Jacobsen s method Tomas Jakobsen presented a totally constraint based method for simulating cloth [3], rigid body movement and also plants and he states that a simulation probably cannot be done faster than this. His method is straightforward and relatively simple and requires, according to himself, only one pass over every constraint in the system per time step. This method was used in the game Hitman: Codename 47 by IO-Interactive back in The method was used for simulation all the physics in the game even plants so the method performs well when it comes to speed. On drawback is that it is heavily damped but this should not be a big problem when simulating cloth because cloth is quite damped and if carefully done numerical damping can be used to simulate physical damping, hence exclude a lot of the physical damping from the simulation. The method presented is, as stated, simple and straight forward. Starting from the rectangular mesh fig.(4.1) a series of constraints is setup between the points. The constraints are the distances between the nodes in the horizontal and vertical direction furthermore constraints that are the distances between neighbors on the diagonal is also set up. The only forces that come into this method are external forces, gravity for example. Choose a stepper, more about the stepper later, and step a time step and in the end of the time step make sure that the constraint is fulfilled one by one, simply by moving particles together. This method, moving particles consequentially, is called relaxation. Relaxation is simply moving particles, to fulfill local constraints, and by iterating over all constraints a number of times each time step all the constraints will, hopefully, be fulfilled in the end of the time step Verlet stepper In his article [3], Jacobsen uses the Verlet-scheme and this stepper is much more stable than the simple explicit Euler, and as stable as symplectic Euler, but it still as easy to

26 16 Chapter 4. Methods for simulating cloth implement. What follows is a derivation of the stepper by a Taylor-expansion of the position in forward and backward direction. x t+dt = x t + x t dt + x t 2 dt x t 3 dt3 + O(dt 4 ) x t+dt = x t x t dt + x t 2 dt 2... x t 3 dt3 + O(dt 4 ) (4.4) Adding the two equations gives x t dt + x t+dt = 2 x t + x t dt 2 + O(dt 4 ) (4.5) Moving the position at t+dt to the RHS, using Newtons second law on the acceleration (second time derivative of the position) and dropping the error-term yields the Verlet scheme. x t+dt = 2 x t x t dt + F m dt2 (4.6) Notice that this stepped does not use the velocity explicitly to calculate the position in the coming timestep. This stepper is of 4th order with respect to the timestep and compared to the explicit Euler which is of 2nd order. There is a way of calculating velocities in every timestep using v n = x t dt x t dt + O(dt 2 ) (4.7) This introduces an 2nd order errorterm so this approximation of the velocity is not very accurate but later, after implementation, there will be clear if this approximation needs to be improved. 4.3 Choosing a suitable method There are many methods available for cloth simulation and there are advantages and disadvantages with every method. There are many methods that have been considered for this work, some where rejected early in the work due to the apprehension that it would be too computationally expensive. For a more or less complete survey i suggest reading Physically based deformable models in computer graphics [1].

27 4.4. Position based dynamics Motivation The aim for this work was to get a fast, stable simulation with accepted visual results. The methods require solving a linear system, FEM and implicit was discharged because of the apprehension that it would take to much time considering the 1ms per frame budget. So the choice stood between position based, constraint method and a system with springs. There is quite easy to motivate that the position based method is the method of choice, solving the problem using springs requires that, at every time step, one pass over the springs is required to keep the springs at an accepted length since a spring that is to long gives a force to large for the system to handle [7]. This means that one pass over every spring per timestep can be seen as one pass over every constraint so the pass over the springs just to keep them at an accepted length is the actual pass for keeping the system together in the position based method. There was also a thought that the lod would be easier to solve if having a method that worked directly on the positions. To attach a piece of cloth to a moving object felt easier as well since, when working on positions directly, the attached particles can simply be set to follow some object. The method used is, because of this, the position based method proposed by Müller et al. since this method fits best into the demands from DICE prior to the start of the project. It has great performance and gives complete control over the positions of the nodes in the mesh. 4.4 Position based dynamics Müller et al. [5] presents a method where they generalizes Jakobsen s method taking any constraint and applying projections based on the gradient of the constraint function. This method is not as easy to implement as Jacobsen s but uses the Explicit Euler scheme to calculate the new positions at every timestep. They also presents a constraint that keeps the angle between adjacent triangles so that one can specify bending stiffness without having to adjust the stiffness of the stretching constraints. In this method, working on the positions directly, one solves for the equilibrium and project the position. This gives a system of second order equations and the system is solved by iterating over the set of constraint and solving projection positions for one constraint at a time. This is exactly what Jakobsen proposed in his article but Jakobsen only handled distance constraints. Müller et al. presents a way of applying position

28 18 Chapter 4. Methods for simulating cloth a b Figure 4.6: Projection of particle on constraintsurface described by a distanceconstraint between the particles a and b. projection for any constraint. This work handles a bending constraint and a distance constraint, but the model applies to any so first the method is explained in a general way followed by a derivation of the two types of constraints handled here Derivation, position projection and constraints Let C( p) be some constraint function to a given position p, then we want a p such that C( p + p) = 0. By expanding this in a 1st order Taylor serie we get C( p + p) C( p) + p C( p) p = 0 (4.8) p must be in the direction of p C( p) so we want to find λ so that p = λ p C( p) (4.9) by inserting eq.(4.9) into eq.(4.8), solving for λ and putting λ back in eq.(4.9) we get an expression for valid p.

29 4.4. Position based dynamics 19 Now a correction for a single point can be written as, p = pc( p) C( p) (4.10) p C( p) 2 p i = s pi C( p 1,..., p n ) (4.11) with, s = C( p 1,..., p n ) j p j C( p 1,..., p n ) 2 (4.12) The scaling factor eq.(4.12) is constant for all points involved in the constraint. If the point have different masses the projection has to be scaled with respect to the masses, because a light particle won t affect the system as much as a heavy on, so the scaling factor becomes, s = C( p 1,..., p n ) j w i pj C( p 1,..., p n ) 2 (4.13) where w = 1/m, m being the mass of a particle. Finally the correction can be written as, p i = sw i pi C( p 1,..., p n ). (4.14) In this thesis two special cases has been implemented, both are taken from the article by Müller et al [5]. The two cases are distance and bending constraint and the reason for the separation is that it seems like a good thing to be able to control bending separately from the stretching of the cloth. The constraints are solved one by one at every timestep making the system converge towards the correct solution however the system will not converge exactly if the number of iteration over the constraints are kept low. This method is called relaxation. Distance constraint These constraints purpose is to keep the shape of the cloth and there are two different ones, shear and structure. The constraint function for a distance constraint can be written as,

30 20 Chapter 4. Methods for simulating cloth C( p 1, p 2 ) = p 1 p 2 d = 0 (4.15) with derivatives, p1 C( p 1, p 2 ) = p2 C( p 1, p 2 ) = p 1 p 2 p 1 p 2. (4.16) Using eq.(4.14), eq.(4.15) and eq.(4.16) the final corrections for the projection of a distance constraint becomes p 1 = w 1 w 1 + w 2 ( p 1 p 2 d) p 1 p 2 p 1 p 2 (4.17) and p 2 = + w 2 w 1 + w 2 ( p 1 p 2 d) p 1 p 2 p 1 p 2. (4.18) Bending constraint The other constraint is the constraint that keeps the normals of adjacent triangles at a certain angle. The constraint for bending is C( p 1, p 2, p 3, p 4 ) = arccos( n 1, n 2 ) ϕ 0 (4.19) Where ϕ 0 is the desired angle between the two normals. Computing the projection for the points involved in this constraint is not as straight forward as with the distance constraints because it is required to compute the gradient of the normalized cross product. Given a normalized cross product between the vectors v 1 and v 2, the derivatives with respect to the vectors are n = v 1 v 2 v 1 v 2, (4.20) n 1 1 = v 1 v 1 v 2 ( v 2 + n( n v 2 ) T ) (4.21)

31 4.4. Position based dynamics 21 2 n n 1 1 Figure 4.7: Two triangles adjacent to each other, masspoints are numbered and normals face in the oposite direction. n 2 1 = v 1 v 1 v 2 ( v 1 + n( n v 1 ) T ) (4.22) where the matrix v has the property v x = v x Setting p 1 = 0 and replacing the normals in eq.(4.19) with n 1 = p 2 p 3 p 2 p 3 (4.23) and n 2 = p 2 p 4 p 2 p 4 (4.24) eq.(4.19) becomes C( p 1, p 2, p 3, p 4 ) = arccos(d) ϕ 0, (4.25) with d = n T 1 n 2. d Since, dx arccos(d) = 1 1 d, the gradients of eq.(4.19) becomes 2

32 22 Chapter 4. Methods for simulating cloth n 2 1,2 4 3 n 1 Figure 4.8: The same triangles as in fig.(4.7) seen from another angle showing the angle between the triangles normals. 1 p3 C = (( n 1 ) T n 2 ) (4.26) 1 d 2 p 3 1 p4 C = (( n 2 ) T n 1 ) (4.27) 1 d 2 p 4 1 p2 C = (( n 1 ) T n 2 + ( n 2 ) T n 1 ) (4.28) 1 d 2 p 2 p 2 p1 C = p2 C p3 C p4 C. (4.29) By using the relations in eg.(4.21) and 4.22 the derivatives in eq.(4.26) - eq.(4.29) can be computed as, q 3 = p 2 n 2 + ( n 1 p 2 )d p 2 p 3 (4.30)

33 4.4. Position based dynamics 23 q 4 = p 2 n 1 + ( n 2 p 2 )d p 2 p 3 (4.31) q 3 = p 3 n 2 + ( n 1 p 3 )d p 2 p 3 p 4 n 1 + ( n 2 p 4 )d p 2 p 4 (4.32) q 1 = q 2 q 3 q 4. (4.33) Finally the correction for a bending constraint can be written as, p i = 4w i 1 d2 (arccos(d) ϕ 0 ) j w j j q j 2 q j (4.34) The denominators in eq.( ) can become invalid if one of the vectors are close to zero or if the triangle is highly elongated so in the implementation one has to check for theses special cases.

34 24 Chapter 4. Methods for simulating cloth

35 Chapter 5 Implementation 5.1 Core Simulation The core simulation is straight forward making is easy to implement and to understand. The simulation of the system is done as follows; 1.1 Setup the initial positions, velocities and masses. 1.2 loop as long as system is active assemble external force (wind, gravity) integrate and damp velocities, v = v + twf ext k d integrate positions to get new estimates p = x + tv generate collision constraints solve constraints update velocities v = (p x) t update position x = p calculate triangle normals Note that the LOD-level i chosen before step and is determined by the distance to the camera. The constraint projection i.e solving the constraints, works on the estimates and after that the velocities are set to values that would have taken the initial positions to the position after the projection, making the velocities valid for the next turn in the loop. 25

36 26 Chapter 5. Implementation Damping Müller et al. presents a way to damp the velocities that doesn t affect the global movement of the particle system. This method works good but the computational cost is to high because it involves computing the inertia tensor and taking its inverse. The total cost for using this more advanced damping model is approximately 25% of the total computation time per frame. In this work damping is simply performed by multiplying the velocities by a scalar between 0 and 1, this gives a nonrealistic behavior if the value is not close to 1 but computational speed is greatly improved compared to the more advanced approach. The more advanced damping model is explained in the appendix Air resistance Force from both wind and the drag due to the cloths own velocity is modeled for each triangle in the mesh and the distributed equally to every node in the triangle. n p 2 v p 1 p 3 w Figure 5.1: One triangle with its nodes p 1 p 3, normal n, velocity v and external wind w. The drag due to the triangles velocity is modeled as

37 5.1. Core Simulation 27 F drag = ρ( v n) 2 A v v, (5.1) where ρ 1 is some drag coefficient A is the area of the triangle. Force from an explicit wind is modeled in a similar fashion, F wind = ρ( w n)a n n. (5.2) The force due to drag eq.(5.1) cannot change the direction of the triangles velocity so if this happens simply set it to Level of detail Level of detail (lod) is handled by multiple meshes that represent the same piece of cloth and which mesh is used is determined by the distance to the viewer. At initialization of the system every lod, despite for the level with the highest resolution are given indices to it s neighbors in the level below so that the position and velocity for a node introduced when going from coarser to finer mesh can be interpolated as the average from the assigned nodes. The different lod-meshes have different masses for each node since mass is calculated from one third of each triangle it borders and every triangle gets a mass during initialization calculated from a user defined density and the triangles area. In fig.(5.2) node 5 knows about nodes 1, 3, 7, and 9 so when going from a coarser to a finer grid node 5 gets it s velocity and position from these nodes. Going from a finer to a coarser grid is much more simple sine the nodes left in the coarser grid keeps its position and velocity. The level of detail is the most important thing when it comes to performance; at distance one can hardly tell the difference between a coarse and a fine grid. The overhead for the level of detail is mainly in memory, not keeping the same positions etc. for nodes shared by lod-levels takes up more memory. There are not so much computation done when going between different levels and furthermore the code becomes more cache 2 efficient if data is more closely packed at different levels. 1 in a more accorate model ρ would consist of two part; one describing the viscosity of the fluid and the other a material property. But here the two are combined to reduced the variables required. 2 A cache is a temporary storage area where frequently accessed data can be stored for rapid access.

38 28 Chapter 5. Implementation Figure 5.2: Small grid with two lod-levels where the black nodes are coarse grid Attaching the cloth By using the Frostbite Engine it was interesting to attach cloth to vehicles; this is done by simply choosing one side of the cloth, give the particles on that side infinite mass and finally let the particles follow the vehicles transformation. A particle with infinite mass has zero inverse mass so there are no reason to keep the actual mass.

39 Chapter 6 Result I have based the result on the initial request from DICE and how well this work had met these demands, very little focus has been put into the actual physical correctness of the simulation. The results are all based on computational and visual performance but as stated by many others, if it looks convincing it is probably close to a physically correct simulation [2] p.327. Game companies normally use visual results to ensure quality so visual and computational performance is the measurements that have been made to ensure quality. 6.1 Visual The visual result are good, a clothlike behavior that meets the demands from DICE. Especially drapes and flags. The parasol looks ok and there is really no need to simulate more than the outer parts since the actual parasol doesn t move much in the wind. It is not easy to setup the stiffness so that the lodding is made easy. There are some issues with the cloth appearing stiffer at distance because of the fact that the solver solves the system better with fewer constraints. This problem can be solved if the stiffness for the constraints are chosen so that the solver returns a less accurate solution and/or if some constraints are simply not included into more sparser meshes. i.e, remove shear and bend constraints. 29

40 30 Chapter 6. Result Figure 6.1: The eight flags that are used in the timing in fig.(6.2). 6.2 Computational The simulation had a budget, 1ms per frame and at 30 Hz the simulation meets this budget. It is not possible to have too many flags onscreen at the highest lod-level but if the game is setup with this in mind I see no reason why this method won t fit into the engine. The most expensive step in the simulation is the bending constraints and the damping. The bending constraints requires 4 cross products per constraint and the damping runs slow due to the fact that an inverse of a matrix has to be calculated in every timestep and this is the reason why the more advanced was implemented but not activated in the final product. If only visual performance is the goal, tests have shown that the damping can be replaced by a much more simple model and thus solving this issue. The bending constraints can be replaced by using distance constraints in the same way as the bending springs in fig.(4.4). The ability to change the meshes resolution greatly increase performance; fig.(6.2) shows that the time needed to simulate a sheet of cloth decreases almost at a factor 1 x2 with respect to the lod level. Furthermore fig.(b.1) shows how the total time needed in every frame is divided between different parts of the simulation at different lod-levels. As can be seen in fig.(6.2) a scene with 8 flags at highest lod-level takes approximately 1.6ms and the same scene at the lowest level takes up only 0.2ms so there are a lot of gain in computational time with an efficient lod-system.

41 6.2. Computational 31 n 2 1,2 4 3 n 1 Figure 6.2: Different number of sheets of cloth at different lod levels plotted against simulation time [ms].

42 32 Chapter 6. Result

43 Chapter 7 Conclusions The method presented here where suited for DICE; the simulation handled lod in an efficient way and the visual output is very good. Computational performance met the demand with some limitations in number of high resolution flags close to the camera and total number of flags on screen. The work was integrated with the engine but is currently not in use, still the work is a proof of concept for the selected method. 7.1 Limitations and future work Despite the visual quality from this simulation there are many things that can be improved so the list of limitation can be made long and a lot of them can be removed by continue working on the project. Better tools for setting up the cloth, attachments and more general meshes, so that artists and level designers can make use of the software. Vectorizing the code using the SIMD instruction set would speed up the calculations. Better renderer and shaders. Müller [6] presented in November 2000 improvement of the position based dynamics model for high resolution grids using a multigrid solver. Since this work is based on multiple grids for one patch of cloth it would be easy to integrate this idea making the solver much more accurate. 33

44 34 Chapter 7. Conclusions A more general collision model that handles more primitives and general triangle meshes. Performance can be increased by first looking at fig.(b.1). Implement tearing.

45 Chapter 8 Acknowledgements I would like to thank everyone at DICE who has helped me during this project; Joakim Lord and Torbjörn Söderman who has been my supervisors. Christofer Stegmayr for all the good talks and ideas. Mattias Widmark, who was very helpful and patient when he helped me implement the renderer. Henrik Karlsson who made thing clear about the Entity and Component-system in Frostbite. Peppe and Gidlund for helping me with the physics in Frostbite. Hans Mannby for good talks at the early stage. Elin Fällman for helping me with the project plan. Martin Servin who has been my examinator. My parents for supporting my actions in life up to this point. And finally everyone that I have forgotten... 35

46 36 Chapter 8. Acknowledgements

47 References [1] R. Kaiser E. Boxerman M. Carlson A Nealen, M. Müller. Physically based deformable models in computer graphics. Eurographics 2005 state of the art report, [2] Donald H. House and David E. Breen. Cloth Modeling and Animation [3] Thomas Jakobsen. Advanced Character Physics. Technical report, Copenhagen, Denmark. [4] Claude Lacoursière. Ghosts and machines: regularized variational methods for interactive simulations of multibodies with dry frictional contacts. Umeå: Umeå University, Faculty of Science and Technology, Computing Science, ISBN: [5] M. Hennix J. Ratcliff M. Müller, B. Heidelberger. Position based dynamics. Proceedings of Virtual Reality Interactions and Physical Simulations (VRIPhys), pages 71 80, [6] M. Müller. Hierarchical position based dynamics. Workshop on Virtual Reality Interaction and Physical Simulation VRIPHYS (VRIPhys), [7] Xavier Protov. Deformation constraints in a mass-spring model to describe rigid cloth behavior. Graphics Interface, pages ,

48 38 REFERENCES

49 Appendix A Advanced damping If the system has to be damped without damping the global movement of the system a more advanced model than simply decreasing the velocity at every timestep the following algorithm works great but is to computational expensive to be considered in this work. The model has been implemented but fell out due to the previously mentioned fact. First calculate the center of mass and its velocity x cm = i x im i i m i (A.1) v cm = i v im i. (A.2) i m i Second, calculate the angular momentum of the particle system L = i r i m i m i v i. (A.3) The angular velocity is calculated by multiplying the inverse of the inertia tensor with the angular momentum ω = Ī 1 L (A.4) and the inertia tensor is calculated Ī = i r i r T i m i (A.5) 39

50 40 Chapter A. Advanced damping where r is a matrix with the property r x = r x. Finally for all vertices i do v i = v cm + ω r i v i v i = v i + k d v i (A.6) and the term k d is the damping coefficient [0..1].

51 Appendix B Figures Figure B.1: Bars showing how different parts of the simulation is distributed over total simulation time per frame at different LoD levels. 41

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

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Deformable Objects Matthias Teschner Computer Science Department University of Freiburg Outline introduction forces performance collision handling visualization University

More information

Mass-Spring Systems. Last Time?

Mass-Spring Systems. Last Time? Mass-Spring Systems Last Time? Implicit Surfaces & Marching Cubes/Tetras Collision Detection & Conservative Bounding Regions Spatial Acceleration Data Structures Octree, k-d tree, BSF tree 1 Today Particle

More information

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

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller T6: Position-Based Simulation Methods in Computer Graphics Jan Bender Miles Macklin Matthias Müller Jan Bender Organizer Professor at the Visual Computing Institute at Aachen University Research topics

More information

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

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123 2.7 Cloth Animation 320491: Advanced Graphics - Chapter 2 123 Example: Cloth draping Image Michael Kass 320491: Advanced Graphics - Chapter 2 124 Cloth using mass-spring model Network of masses and springs

More information

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

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report Cloth Simulation CGI Techniques Report Tanja Munz Master of Science Computer Animation and Visual Effects 21st November, 2014 Abstract Cloth simulation is a wide and popular area of research. First papers

More information

Cloth Simulation. COMP 768 Presentation Zhen Wei

Cloth Simulation. COMP 768 Presentation Zhen Wei Cloth Simulation COMP 768 Presentation Zhen Wei Outline Motivation and Application Cloth Simulation Methods Physically-based Cloth Simulation Overview Development References 2 Motivation Movies Games VR

More information

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

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama Introduction to Computer Graphics Animation (2) May 26, 2016 Kenshi Takayama Physically-based deformations 2 Simple example: single mass & spring in 1D Mass m, position x, spring coefficient k, rest length

More information

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work Ragdoll Physics Gabe Mulley, Matt Bittarelli April 25th, 2007 Abstract The goal of this project was to create a real-time, interactive, and above all, stable, ragdoll physics simulation. This simulation

More information

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

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC The Jello Cube Assignment 1, CSCI 520 Jernej Barbic, USC 1 The jello cube Undeformed cube Deformed cube The jello cube is elastic, Can be bent, stretched, squeezed,, Without external forces, it eventually

More information

The jello cube. Undeformed cube. Deformed cube

The jello cube. Undeformed cube. Deformed cube The Jello Cube Assignment 1, CSCI 520 Jernej Barbic, USC Undeformed cube The jello cube Deformed cube The jello cube is elastic, Can be bent, stretched, squeezed,, Without external forces, it eventually

More information

Numerical Integration

Numerical Integration 1 Numerical Integration Jim Van Verth Insomniac Games jim@essentialmath.com Essential mathematics for games and interactive applications Talk Summary Going to talk about: Euler s method subject to errors

More information

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

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg Simulation in Computer Graphics Particles Matthias Teschner Computer Science Department University of Freiburg Outline introduction particle motion finite differences system of first order ODEs second

More information

PHYSICALLY BASED ANIMATION

PHYSICALLY BASED ANIMATION PHYSICALLY BASED ANIMATION CS148 Introduction to Computer Graphics and Imaging David Hyde August 2 nd, 2016 WHAT IS PHYSICS? the study of everything? WHAT IS COMPUTATION? the study of everything? OUTLINE

More information

Modeling Cloth Using Mass Spring Systems

Modeling Cloth Using Mass Spring Systems 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

More information

Physics Tutorial 2: Numerical Integration Methods

Physics Tutorial 2: Numerical Integration Methods Physics Tutorial 2: Numerical Integration Methods Summary The concept of numerically solving differential equations is explained, and applied to real time gaming simulation. Some objects are moved in a

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Pop Worksheet! Teams of 2. Hand in to Jeramey after we discuss. Sketch the first few frames of a 2D explicit Euler mass-spring simulation for a 2x3 cloth network

More information

Lesson 1: Introduction to Pro/MECHANICA Motion

Lesson 1: Introduction to Pro/MECHANICA Motion Lesson 1: Introduction to Pro/MECHANICA Motion 1.1 Overview of the Lesson The purpose of this lesson is to provide you with a brief overview of Pro/MECHANICA Motion, also called Motion in this book. Motion

More information

Particle Systems. Lecture 8 Taku Komura

Particle Systems. Lecture 8 Taku Komura Particle Systems Computer Animation and Visualisation Lecture 8 Taku Komura Overview Particle System Modelling fuzzy objects (fire, smoke) Modelling liquid Modelling cloth Integration : implicit integration,

More information

Cloth Hair. and. soft bodies

Cloth Hair. and. soft bodies Cloth Hair Lesson 11 and soft bodies Lesson 08 Outline Problem definition and motivations Modeling deformable solids with mass-spring model Position based dynamics Modeling cloths with mass-spring model

More information

Physically Based Simulation

Physically Based Simulation CSCI 480 Computer Graphics Lecture 21 Physically Based Simulation April 11, 2011 Jernej Barbic University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s11/ Examples Particle Systems Numerical

More information

Physically Based Simulation

Physically Based Simulation CSCI 420 Computer Graphics Lecture 21 Physically Based Simulation Examples Particle Systems Numerical Integration Cloth Simulation [Angel Ch. 9] Jernej Barbic University of Southern California 1 Physics

More information

Physically based modelling Computer Graphics I February 27, 2003

Physically based modelling Computer Graphics I February 27, 2003 Physically based modelling 15-462 Computer Graphics I February 27, 2003 Outline Overview Particle systems Numerical solution of ODEs Constraints Collisions Motivation Animation is hard! Secondary motion

More information

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

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 CENG 732 Computer Animation This week Inverse Kinematics (continued) Rigid Body Simulation Bodies in free fall Bodies in contact Spring 2006-2007 Week 5 Inverse Kinematics Physically Based Rigid Body Simulation

More information

CLOTH - MODELING, DEFORMATION, AND SIMULATION

CLOTH - MODELING, DEFORMATION, AND SIMULATION California State University, San Bernardino CSUSB ScholarWorks Electronic Theses, Projects, and Dissertations Office of Graduate Studies 3-2016 CLOTH - MODELING, DEFORMATION, AND SIMULATION Thanh Ho Computer

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Optional Reading for Last Time: Spring-Mass Systems Numerical Integration (Euler, Midpoint, Runge-Kutta) Modeling string, hair, & cloth HW2: Cloth & Fluid Simulation

More information

Lecture VI: Constraints and Controllers. Parts Based on Erin Catto s Box2D Tutorial

Lecture VI: Constraints and Controllers. Parts Based on Erin Catto s Box2D Tutorial Lecture VI: Constraints and Controllers Parts Based on Erin Catto s Box2D Tutorial Motion Constraints In practice, no rigid body is free to move around on its own. Movement is constrained: wheels on a

More information

Lecture VI: Constraints and Controllers

Lecture VI: Constraints and Controllers Lecture VI: Constraints and Controllers Motion Constraints In practice, no rigid body is free to move around on its own. Movement is constrained: wheels on a chair human body parts trigger of a gun opening

More information

Real Time Cloth Simulation

Real Time Cloth Simulation Real Time Cloth Simulation Sebastian Olsson (81-04-20) Mattias Stridsman (78-04-13) Linköpings Universitet Norrköping 2004-05-31 Table of contents Introduction...3 Spring Systems...3 Theory...3 Implementation...4

More information

Numerical Simulation of Dynamic Systems XXIV

Numerical Simulation of Dynamic Systems XXIV Numerical Simulation of Dynamic Systems XXIV Prof. Dr. François E. Cellier Department of Computer Science ETH Zurich May 14, 2013 Introduction Introduction A number of important simulation applications

More information

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

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE Computer Animation Algorithms and Techniques Rick Parent Ohio State University z< MORGAN KAUFMANN PUBLISHERS AN IMPRINT OF ELSEVIER SCIENCE AMSTERDAM BOSTON LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO

More information

Application of Finite Volume Method for Structural Analysis

Application of Finite Volume Method for Structural Analysis Application of Finite Volume Method for Structural Analysis Saeed-Reza Sabbagh-Yazdi and Milad Bayatlou Associate Professor, Civil Engineering Department of KNToosi University of Technology, PostGraduate

More information

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

Development of the Compliant Mooring Line Model for FLOW-3D Flow Science Report 08-15 Development of the Compliant Mooring Line Model for FLOW-3D Gengsheng Wei Flow Science, Inc. October 2015 1. Introduction Mooring systems are common in offshore structures, ship

More information

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

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang 4th International Conference on Sensors, Measurement and Intelligent Materials (ICSMIM 2015) Interaction of Fluid Simulation Based on PhysX Physics Engine Huibai Wang, Jianfei Wan, Fengquan Zhang College

More information

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs) OBJECTIVE FLUID SIMULATIONS Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs) The basic objective of the project is the implementation of the paper Stable Fluids (Jos Stam, SIGGRAPH 99). The final

More information

Fundamentals of Computer Animation

Fundamentals of Computer Animation Fundamentals of Computer Animation Flexible Objects (1) page 1 Flexible Objects Elastic and inelastic behavior, viscoelasticity, plasticity, fracture Elastically Deformable Models Terzopoulos et al SIGGRAPH

More information

DYNAMICS FOR ANIMATION. Rémi Ronfard, Animation, M2R MOSIG

DYNAMICS FOR ANIMATION. Rémi Ronfard, Animation, M2R MOSIG DYNAMICS FOR ANIMATION Rémi Ronfard, Animation, M2R MOSIG Summary of physics-based animation Motivation Newton s Laws Point-mass models Rigid and articulated bodies Ragdoll physics From kinematics to dynamics

More information

THE development of stable, robust and fast methods that

THE development of stable, robust and fast methods that 44 SBC Journal on Interactive Systems, volume 5, number 1, 2014 Fast Simulation of Cloth Tearing Marco Santos Souza, Aldo von Wangenheim, Eros Comunello 4Vision Lab - Univali INCoD - Federal University

More information

Cloth Animation with Collision Detection

Cloth Animation with Collision Detection Cloth Animation with Collision Detection Mara Guimarães da Silva Figure 1: Cloth blowing in the wind. Abstract This document reports the techniques and steps used to implemented a physically based animation

More information

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

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

More information

Simulating Sinkage & Trim for Planing Boat Hulls. A Fluent Dynamic Mesh 6DOF Tutorial

Simulating Sinkage & Trim for Planing Boat Hulls. A Fluent Dynamic Mesh 6DOF Tutorial Simulating Sinkage & Trim for Planing Boat Hulls A Fluent Dynamic Mesh 6DOF Tutorial 1 Introduction Workshop Description This workshop describes how to perform a transient 2DOF simulation of a planing

More information

CS 231. Deformation simulation (and faces)

CS 231. Deformation simulation (and faces) CS 231 Deformation simulation (and faces) 1 Cloth Simulation deformable surface model Represent cloth model as a triangular or rectangular grid Points of finite mass as vertices Forces or energies of points

More information

1.2 Numerical Solutions of Flow Problems

1.2 Numerical Solutions of Flow Problems 1.2 Numerical Solutions of Flow Problems DIFFERENTIAL EQUATIONS OF MOTION FOR A SIMPLIFIED FLOW PROBLEM Continuity equation for incompressible flow: 0 Momentum (Navier-Stokes) equations for a Newtonian

More information

Example 24 Spring-back

Example 24 Spring-back Example 24 Spring-back Summary The spring-back simulation of sheet metal bent into a hat-shape is studied. The problem is one of the famous tests from the Numisheet 93. As spring-back is generally a quasi-static

More information

Motion Capture & Simulation

Motion Capture & Simulation Motion Capture & Simulation Motion Capture Character Reconstructions Joint Angles Need 3 points to compute a rigid body coordinate frame 1 st point gives 3D translation, 2 nd point gives 2 angles, 3 rd

More information

Navier-Stokes & Flow Simulation

Navier-Stokes & Flow Simulation Last Time? Navier-Stokes & Flow Simulation Implicit Surfaces Marching Cubes/Tetras Collision Detection & Response Conservative Bounding Regions backtracking fixing Today Flow Simulations in Graphics Flow

More information

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

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion? Chapter 3 : Computer Animation (continued) Chapter 3: Computer Animation Reminder: Descriptive animation Describes a single motion, with manual control Ex: direct kinematics with key-frames, inverse kinematics

More information

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

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015 PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015 Cloth Simulation Cloth simulation has been an important topic in computer

More information

Project 1: Particle System The Animation of Natural Phenomena Due 10/18

Project 1: Particle System The Animation of Natural Phenomena Due 10/18 Project 1: Particle System The Animation of Natural Phenomena Due 10/18 In this project you will implement a particle system with constraints. You must implement at least the required features. You must

More information

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

Animation. Itinerary. What is Animation? What is Animation? Animation Methods. Modeling vs. Animation Computer Graphics Lecture 22 15-462 Computer Graphics Lecture 22 Animation April 22, 2003 M. Ian Graham Carnegie Mellon University What is Animation? Making things move What is Animation? Consider a model with n parameters Polygon

More information

Animation. Itinerary Computer Graphics Lecture 22

Animation. Itinerary Computer Graphics Lecture 22 15-462 Computer Graphics Lecture 22 Animation April 22, 2003 M. Ian Graham Carnegie Mellon University Itinerary Review Basic Animation Keyed Animation Motion Capture Physically-Based Animation Behavioral

More information

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH DYNAMIC SIMULAION OF INEXENSIBLE CLOH Jan Bender, Daniel Bayer and Raphael Diziol Institut für Betriebs- und Dialogssysteme Universität Karlsruhe Am Fasanengarten 5 768 Karlsruhe Germany ABSRAC In this

More information

Praktikum 2014 Parallele Programmierung Universität Hamburg Dept. Informatics / Scientific Computing. October 23, FluidSim.

Praktikum 2014 Parallele Programmierung Universität Hamburg Dept. Informatics / Scientific Computing. October 23, FluidSim. Praktikum 2014 Parallele Programmierung Universität Hamburg Dept. Informatics / Scientific Computing October 23, 2014 Paul Bienkowski Author 2bienkow@informatik.uni-hamburg.de Dr. Julian Kunkel Supervisor

More information

CS 231. Deformation simulation (and faces)

CS 231. Deformation simulation (and faces) CS 231 Deformation simulation (and faces) Deformation BODY Simulation Discretization Spring-mass models difficult to model continuum properties Simple & fast to implement and understand Finite Element

More information

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

Shape of Things to Come: Next-Gen Physics Deep Dive Shape of Things to Come: Next-Gen Physics Deep Dive Jean Pierre Bordes NVIDIA Corporation Free PhysX on CUDA PhysX by NVIDIA since March 2008 PhysX on CUDA available: August 2008 GPU PhysX in Games Physical

More information

COPYRIGHTED MATERIAL INTRODUCTION CHAPTER 1

COPYRIGHTED MATERIAL INTRODUCTION CHAPTER 1 CHAPTER 1 INTRODUCTION Modern mechanical and aerospace systems are often very complex and consist of many components interconnected by joints and force elements such as springs, dampers, and actuators.

More information

Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering. Introduction

Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering. Introduction Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering Introduction A SolidWorks simulation tutorial is just intended to illustrate where to

More information

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural 1 Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural to consider using it in video games too. 2 I hope that

More information

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11] Fluid Simulation [Thürey 10] [Pfaff 10] [Chentanez 11] 1 Computational Fluid Dynamics 3 Graphics Why don t we just take existing models from CFD for Computer Graphics applications? 4 Graphics Why don t

More information

CS4621/5621 Fall Particle Systems and Compute Shaders

CS4621/5621 Fall Particle Systems and Compute Shaders CS4621/5621 Fall 2015 Particle Systems and Compute Shaders Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang and Pramook

More information

Chapter 1 - Basic Equations

Chapter 1 - Basic Equations 2.20 Marine Hydrodynamics, Fall 2017 Lecture 2 Copyright c 2017 MIT - Department of Mechanical Engineering, All rights reserved. 2.20 Marine Hydrodynamics Lecture 2 Chapter 1 - Basic Equations 1.1 Description

More information

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project presented to the Faculty of the Computer Science Department of California Polytechnic State University, San Luis Obispo In Partial Fulfillment

More information

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

3D Physics Engine for Elastic and Deformable Bodies. Liliya Kharevych and Rafi (Mohammad) Khan Advisor: David Mount 3D Physics Engine for Elastic and Deformable Bodies Liliya Kharevych and Rafi (Mohammad) Khan Advisor: David Mount University of Maryland, College Park December 2002 Abstract The purpose of this project

More information

A Fast and Stable Approach for Restoration of Warped Document Images

A Fast and Stable Approach for Restoration of Warped Document Images A Fast and Stable Approach for Restoration of Warped Document Images Kok Beng Chua, Li Zhang, Yu Zhang and Chew Lim Tan School of Computing, National University of Singapore 3 Science Drive 2, Singapore

More information

Cloth Simulations. 9.2 Physics - Cloth Simulations

Cloth Simulations. 9.2 Physics - Cloth Simulations 9.2 Physics - Cloth Simulations Cloth Simulations...1 Description...2 Workflow...2 Cloth Panel...3 Material...3 Damping...3 Pinning...4 Pinning Clothing To An Armature...4 Cloth Sewing Springs...5 Collisions...5

More information

CS205b/CME306. Lecture 9

CS205b/CME306. Lecture 9 CS205b/CME306 Lecture 9 1 Convection Supplementary Reading: Osher and Fedkiw, Sections 3.3 and 3.5; Leveque, Sections 6.7, 8.3, 10.2, 10.4. For a reference on Newton polynomial interpolation via divided

More information

Chapter 19- Object Physics

Chapter 19- Object Physics Chapter 19- Object Physics Flowing water, fabric, things falling, and even a bouncing ball can be difficult to animate realistically using techniques we have already discussed. This is where Blender's

More information

Particle-based Fluid Simulation

Particle-based Fluid Simulation Simulation in Computer Graphics Particle-based Fluid Simulation Matthias Teschner Computer Science Department University of Freiburg Application (with Pixar) 10 million fluid + 4 million rigid particles,

More information

Directional Constraint Enforcement for Fast Cloth Simulation

Directional Constraint Enforcement for Fast Cloth Simulation In Proceedings of The Fourth International Conference on Motion in Games (MIG), 2011 Directional Constraint Enforcement for Fast Cloth Simulation Oktar Ozgen and Marcelo Kallmann University of California,

More information

CS 378: Computer Game Technology

CS 378: Computer Game Technology CS 378: Computer Game Technology Dynamic Path Planning, Flocking Spring 2012 University of Texas at Austin CS 378 Game Technology Don Fussell Dynamic Path Planning! What happens when the environment changes

More information

CUDA Particles. Simon Green

CUDA Particles. Simon Green CUDA Particles Simon Green sdkfeedback@nvidia.com Document Change History Version Date Responsible Reason for Change 1.0 Sept 19 2007 Simon Green Initial draft Abstract Particle systems [1] are a commonly

More information

INTRODUCTION CHAPTER 1

INTRODUCTION CHAPTER 1 CHAPTER 1 INTRODUCTION Modern mechanical and aerospace systems are often very complex and consist of many components interconnected by joints and force elements such as springs, dampers, and actuators.

More information

Structure and Synthesis of Robot Motion

Structure and Synthesis of Robot Motion Structure and Synthesis of Robot Motion Dynamics: Constraints, Continua, etc. Subramanian Ramamoorthy School of Informatics 5 February, 2009 Recap Last time, we discussed two major approaches to describing

More information

Space Filling Curves and Hierarchical Basis. Klaus Speer

Space Filling Curves and Hierarchical Basis. Klaus Speer Space Filling Curves and Hierarchical Basis Klaus Speer Abstract Real world phenomena can be best described using differential equations. After linearisation we have to deal with huge linear systems of

More information

1. Carlos A. Felippa, Introduction to Finite Element Methods,

1. Carlos A. Felippa, Introduction to Finite Element Methods, Chapter Finite Element Methods In this chapter we will consider how one can model the deformation of solid objects under the influence of external (and possibly internal) forces. As we shall see, the coupled

More information

CGT 581 G Fluids. Overview. Some terms. Some terms

CGT 581 G Fluids. Overview. Some terms. Some terms CGT 581 G Fluids Bedřich Beneš, Ph.D. Purdue University Department of Computer Graphics Technology Overview Some terms Incompressible Navier-Stokes Boundary conditions Lagrange vs. Euler Eulerian approaches

More information

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

An Educational Rigid-Body Dynamics Physics Engine TJHSST Senior Research Project Proposal Computer Systems Lab An Educational Rigid-Body Dynamics Physics Engine TJHSST Senior Research Project Proposal Computer Systems Lab 2009-2010 Neal Milstein April 9, 2010 Abstract The goal of this project is to create a rigid-body

More information

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial Auto Injector Syringe A Fluent Dynamic Mesh 1DOF Tutorial 1 2015 ANSYS, Inc. June 26, 2015 Prerequisites This tutorial is written with the assumption that You have attended the Introduction to ANSYS Fluent

More information

animation projects in digital art animation 2009 fabio pellacini 1

animation projects in digital art animation 2009 fabio pellacini 1 animation projects in digital art animation 2009 fabio pellacini 1 animation shape specification as a function of time projects in digital art animation 2009 fabio pellacini 2 how animation works? flip

More information

Finite Element Method. Chapter 7. Practical considerations in FEM modeling

Finite Element Method. Chapter 7. Practical considerations in FEM modeling Finite Element Method Chapter 7 Practical considerations in FEM modeling Finite Element Modeling General Consideration The following are some of the difficult tasks (or decisions) that face the engineer

More information

1 Mathematical Concepts

1 Mathematical Concepts 1 Mathematical Concepts Mathematics is the language of geophysical fluid dynamics. Thus, in order to interpret and communicate the motions of the atmosphere and oceans. While a thorough discussion of the

More information

ixcube 4-10 Brief introduction for membrane and cable systems.

ixcube 4-10 Brief introduction for membrane and cable systems. ixcube 4-10 Brief introduction for membrane and cable systems. ixcube is the evolution of 20 years of R&D in the field of membrane structures so it takes a while to understand the basic features. You must

More information

Soft Body. 9.7 Physics - Soft Body

Soft Body. 9.7 Physics - Soft Body 9.7 Physics - Soft Body Soft Body...1 Typical scenarios for using Soft Bodies...2 Creating a Soft Body...3 Simulation Quality...3 Cache and Bake...4 Interaction in real time...5 Tips...5 Exterior Forces...5

More information

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation Cloth Simulation on the GPU Cyril Zeller NVIDIA Corporation Overview A method to simulate cloth on any GPU supporting Shader Model 3 (Quadro FX 4500, 4400, 3400, 1400, 540, GeForce 6 and above) Takes advantage

More information

Cloth and Hair Collisions

Cloth and Hair Collisions algorithm (presented in Section IV-C.2), by using the recent capabilities of GPUs. Koster et al. [78] exploited graphics hardware by storing all the opacity maps in a 3D texture, to have the hair self-shadow

More information

AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO F ^ k.^

AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO F ^ k.^ Computer a jap Animation Algorithms and Techniques Second Edition Rick Parent Ohio State University AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO

More information

Gadget in yt. christopher erick moody

Gadget in yt. christopher erick moody Gadget in yt First of all, hello, and thank you for giving me the opp to speak My name is chris moody and I m a grad student here at uc santa cruz and I ve been working with Joel for the last year and

More information

Learn to use the vector and translation tools in GX.

Learn to use the vector and translation tools in GX. Learning Objectives Horizontal and Combined Transformations Algebra ; Pre-Calculus Time required: 00 50 min. This lesson adds horizontal translations to our previous work with vertical translations and

More information

Assignment 1: Mass-Spring System

Assignment 1: Mass-Spring System Assignment 1: Mass-Spring System Due February 15 at 11:59pm Introduction Mass-spring systems are a fundamental tool in physical simulations, and a wide range of natural phenomena can be described or approximated

More information

Virtual Marionettes: A System and Paradigm for Real-Time 3D Animation

Virtual Marionettes: A System and Paradigm for Real-Time 3D Animation Virtual Marionettes: A System and Paradigm for Real-Time 3D Animation Adi Bar-Lev, Alfred M. Bruckstein, Gershon Elber Computer Science Department Technion, I.I.T. 32000 Haifa, Israel Abstract This paper

More information

Lagrange Multipliers and Problem Formulation

Lagrange Multipliers and Problem Formulation Lagrange Multipliers and Problem Formulation Steven J. Miller Department of Mathematics and Statistics Williams College Williamstown, MA 01267 Abstract The method of Lagrange Multipliers (and its generalizations)

More information

Strömningslära Fluid Dynamics. Computer laboratories using COMSOL v4.4

Strömningslära Fluid Dynamics. Computer laboratories using COMSOL v4.4 UMEÅ UNIVERSITY Department of Physics Claude Dion Olexii Iukhymenko May 15, 2015 Strömningslära Fluid Dynamics (5FY144) Computer laboratories using COMSOL v4.4!! Report requirements Computer labs must

More information

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Eulerian Grid Methods The methods covered so far in this course use an Eulerian grid: Prescribed coordinates In `lab frame' Fluid elements flow

More information

CS770/870 Spring 2017 Animation Basics

CS770/870 Spring 2017 Animation Basics Preview CS770/870 Spring 2017 Animation Basics Related material Angel 6e: 1.1.3, 8.6 Thalman, N and D. Thalman, Computer Animation, Encyclopedia of Computer Science, CRC Press. Lasseter, J. Principles

More information

CS770/870 Spring 2017 Animation Basics

CS770/870 Spring 2017 Animation Basics CS770/870 Spring 2017 Animation Basics Related material Angel 6e: 1.1.3, 8.6 Thalman, N and D. Thalman, Computer Animation, Encyclopedia of Computer Science, CRC Press. Lasseter, J. Principles of traditional

More information

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016

FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016 FLUENT Secondary flow in a teacup Author: John M. Cimbala, Penn State University Latest revision: 26 January 2016 Note: These instructions are based on an older version of FLUENT, and some of the instructions

More information

How to Perform a Quasi-Static Curving Analysis with SIMPACK Wheel/Rail

How to Perform a Quasi-Static Curving Analysis with SIMPACK Wheel/Rail How to Perform a Quasi-Static Curving Analysis with SIMPACK Wheel/Rail Version 2005-05-11 Table of Contents 1 Introduction 2 1.1 Methods 2 1.1.1 Solving a nonlinear equation system 2 1.1.2 Time integration

More information

Driven Cavity Example

Driven Cavity Example BMAppendixI.qxd 11/14/12 6:55 PM Page I-1 I CFD Driven Cavity Example I.1 Problem One of the classic benchmarks in CFD is the driven cavity problem. Consider steady, incompressible, viscous flow in a square

More information

Karen Liu associate professor at School of Interactive Computing. Murali Varma graduate student at School of Interactive Computing

Karen Liu associate professor at School of Interactive Computing. Murali Varma graduate student at School of Interactive Computing Computer Animation Karen Liu associate professor at School of Interactive Computing Murali Varma graduate student at School of Interactive Computing Administrations http://www.cc.gatech.edu/classes/ay2012/

More information

2.11 Particle Systems

2.11 Particle Systems 2.11 Particle Systems 320491: Advanced Graphics - Chapter 2 152 Particle Systems Lagrangian method not mesh-based set of particles to model time-dependent phenomena such as snow fire smoke 320491: Advanced

More information

Cloth The Animation of Natural Phenomena Adrien Treuille

Cloth The Animation of Natural Phenomena Adrien Treuille Cloth The Animation of Natural Phenomena Adrien Treuille Real Cloth Overview Properties of Real Cloth Cloth Simulation Properties of Cloth sheet of fabric (4) parameter for stretching (1) (4) parameter

More information