Cloth Simulation By Chris Szendrovits o based on Jim Adams “Soft Body Mesh” demo.

Slides:



Advertisements
Similar presentations
Newtons Laws: Identifying Forces on objects One of the key concepts in Mechanics is identifying what forces are acting and drawing a Force diagram, also.
Advertisements

How are Mass and Weight Different??
The Force and Related Concepts.
Force Defined as a push or pull that one body exerts on another
The wind pushes against the man and his umbrella
Notes Titles: What is a Force? Combining Forces Friction Gravity
Chapter 4 The Laws of Motion.
Forces Force is the cause of acceleration. It is defined as a push or a pull.
FORCES. Force is a vector quantity and is measured in newtons (1N) There are different type of forces: – weight – friction force – normal reaction force.
Instructor: Dr. Tatiana Erukhimova
Instructor: Dr. Tatiana Erukhimova
Physics 218: Mechanics Instructor: Dr. Tatiana Erukhimova Sections 818, 819, 820, 821 Lecture 10.
Vocabulary and Formulae Created by Beverley Sutton Pueblo Gardens PreK-8.
PRINCIPLE OF WORK AND ENERGY (Sections )
Vectors 1D kinematics 2D kinematics Newton’s laws of motion
Physics Chapter 6 Forces. Newton’s Laws of Motion 1 st Law (Law of inertia) –An object moving at constant velocity keeps moving at that velocity unless.
Ch. 8.2 Acceleration and Force
SACE Stage 1 Conceptual Physics
Newton’s 2 nd Law. Force on Object Objects acted on by a net unbalanced force will accelerate in the direction of the force This means they will speed.
Force A push or pull exerted on an object..
Physically Based Modeling Let physics take over!.
Chapter 3 Section 3 Pages 81-86
Physics The study of physical forces and qualities: the scientific study of matter, energy, force, and motion, and the way they relate to each other The.
Physics Unit Four Forces that Affect Motion. Force A push or a pull. Measured in newtons with a spring scale. 1 newton (N) = 1 kg m/s 2 An apple weighs.
Simple Harmonic Motion
Mechanics Topic 2.2 Forces and Dynamics. Forces and Free-body Diagrams To a physicist a force is recognised by the effect or effects that it produces.
Chapter 4 Dynamics: Newton’s Laws of Motion
Chapter 4 Newton’s Laws of Motion. Newton’s First Law of Motion Every object continues in its state of rest, or of uniform motion in a straight line,
What is a Newton? Key Question: Investigation 5A
Dynamics: Newton’s Laws of Motion. Concepts Force Newton’s First Law of Motion Mass Newton’s Second Law of Motion Newton’s Third Law of Motion Weight.
Forces & Motion “Trust the Force Luke” Forces Forces.
Forces and Motion PS C-5.
Types of Forces.
Equilibrium & Newton’s 2nd Law of Motion
FORCE is any push or pull which causes something to move or change its speed or direction.
Unit 2: Dynamics: Chapter 3: Forces
Chapters 5, 6 Force and Motion. Newtonian mechanics Describes motion and interaction of objects Applicable for speeds much slower than the speed of light.
1 Ch 11 Forces 11.1 Forces Change Motion. 2 A force is a push or pull –Some require contact between objects, such as friction –Some act at a distance,
Physics the study of the relationship between matter and energy
Kinematics Variables Time: temporal characteristics of a performance, either of the total skill or its phases Displacement: length and direction of the.
UNIT TWO: Motion, Force, and Energy
Forces - basic physics Gravity Friction - static and kinetic Viscosity
Unit 4 Lesson 2 Balanced and Unbalanced Forces
12.1 Forces Bellringer 2/22 1.What do you think is a force? 1.Name some forces you can think of off the top of your head. 1.How do you think we measure.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 29 Soft Bodies and Rigid Bodies.
Forces. What is a Force? A force is a push or pull acting on an object that changes the motion of the object.
Forces. Log into my website, click the Introduction to Forces Notes On a note card, define the following terms: Force Newton Unbalanced force Contact.
Gravitational Force  Gravity= a force of attraction between objects, “pulls” objects toward each other  Law of universal gravitation= all objects in.
Chapter 4 Forces and Newton’s Laws of Motion. Newtonian mechanics Describes motion and interaction of objects Applicable for speeds much slower than the.
Calculating Force and Types of Friction
Balanced and Unbalanced Forces
Forces - basic physics Gravity Friction - static and kinetic Viscosity
Topic 2.2 Forces and Dynamics
Forces - basic physics Springs (Hooke’s law) Damping Gravity
Computer Animation Ying Zhu Georgia State University
Gravity and Friction Vocabulary
Forces.
Newton’s Laws of Motion
How to calculate a dot product
Chapter Five: Forces 5.1 Forces 5.2 Friction
Connecting Motion with Forces
Unit 4 Lesson 2 Balanced and Unbalanced Forces
Science Chapter 15 Lesson 1
Science Chapter 15 Lesson 1
What Is a Force? A _______ is a push or a pull that acts on an object.
The Basics of FORCES.
Newton’s 1st Law – Inertia
Lesson 3 Reading Guide - Vocab
Forces Physics- Ms. Jeffrey.
Forces.
Presentation transcript:

Cloth Simulation By Chris Szendrovits o based on Jim Adams “Soft Body Mesh” demo

Cloth Points & Springs Mesh vertices need the ability to deform and then recover This is done by adding cloth points and cloth springs Cloth Points have a position and a mass, and begin with the same position as the mesh vertices Cloth Springs contain two points, a resting length, a damping value, and a stiffness value Cloth Point (mesh vertex) Cloth Spring (polygon edge)

Cloth Point Example struct sClothPoint { D3DXVECTOR3 m_vecPos;// Current point coords D3DXVECTOR3 m_vecForce;// Force applied to point D3DXVECTOR3 m_vecVelocity;// Velocity of point float m_Mass;// Mass of object };

Cloth Spring Example class cClothSpring { public: int m_Point1; // First point in spring intm_Point2; // Second point in spring floatm_RestingLength; // Resting length of spring floatm_Stiffness; // Spring stiffness constant value floatm_Damping; // Spring damping value cClothSpring *m_Next; // Next in linked list public: cClothSpring() { m_Next = NULL; } ~cClothSpring() { delete m_Next; m_Next = NULL; } };

Applying Forces to Cloth A number of different forces may affect a cloth’s points: wind, gravity, friction, and collision The springs themselves also apply forces to eachother A Spring will expand and contract according to their damping and stiffness values Stiffness defines how much force a spring exerts in an attempt to return to its natural length Damping smooths out the motion of the points by reducing the amount of force a spring exerts

Wind Forces Applying wind forces isn’t as simple as adding a directional vector to the cloth points (eg. Gravity) The applied force is proportional to the surface area of the triangle Luckily, using the cross product to calculate the triangle normal gives you a length vector that is proportional to the area of the triangle D3DXVec3Cross(&vecNormal, &vecEdge1, &vecEdge2); D3DXVec3Normalize(&vecNormal, &vecNormal);

Wind Forces continued.. The wind force will always be in the direction of the triangle normal First we need to find, using a dot product calculation, the angle between the wind and the normal. float angle = D3DXVec3Dot(&vecNormal, vecWind); By using the angle to scale the normal we can calculate the amount of force to apply to each cloth point D3DXVECTOR3 vecWindForce = vecNormal * angle; ClothPoint[i].m_vecForce += vecWindForce; Normal Wind Force

Spring Forces Each spring begins with an initial resting length This is the distance between the two points that the spring connects D3DXVECTOR3 vecSpring = ClothPoint[a].m_vecPos – ClothPoint[b].m_vecPos; float SpringLength = D3DXVec3Length(&vecSpring);

Spring Forces continued.. When the cloth points begin to move, we need to calculate its current length in comparison with its resting length With this value we either pull or push the cloth points back to their natural resting length float SpringForce = m_Stiffness * (SpringLength – m_RestingLength); vecSpring /= SpringLength; // Normal the spring to get the direction vecSpring *= SpringForce; // Calculate a force vector // Add forces to cloth points ClothPoint[a].m_vecForce += vecSpring; ClothPoint[b].m_vecForce -= vecSpring;

Damping Forces As the cloth moves through air, friction forces, or linear damping, will slow it down Damping is a force that is proportional to the velocity (F=kV) D3DXVECTOR3 vecRelVelocity = ClothPoint[a].m_vecVelocity – ClothPoint[b].m_vecVelocity; float Velocity = D3DXVec3Dot(&vecRelVelocity, &vecSpring) / SpringLength; float DampingForce = m_Damping * Velocity; vecSpring *= (SpringForce + DampingForce);

Summary First create the cloth points and cloth springs Next update the cloth points based on all the forces being exerted on them  Damping, Spring, Wind, Gravity, Collision Finally, rebuild the mesh based on the new position of the cloth points