Download presentation
Presentation is loading. Please wait.
Published byBarbara McGee Modified over 8 years ago
1
aselab 東工大長谷川 ( 晶 ) 研 PHYSICS ENGINE Rigid body simulator introduction Continuum simulation The Documents http://haselab.net/class/vr user : basic passwd : prog
2
Introduction for rigid body physics engine
3
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 What is physics engine ? Usual modeling of dynamics and simulation Manual formulation simulate this equation by ODE Solver Find this equation with mysterious algorithm in human brain. Lagrangian also requires some human intelligence to find formulation of energy
4
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 What is physics engine ? Physics engine Forward dynamics is automatically computed from the configuration of the scene with formal algorithm. So, physics engine calculate constraint force f c with formal algorithm. ⇒ Human intelligence is no longer required. fcfc Other than constraint force f c, Newton and Euler’s equation requires external force and it’s application point only.
5
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 5 Rigid body motion v:velocity :angular velocity m: mass I: inertial tensor f: external force Velocity and angular velocity are constant in case Equation of motion
6
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Rigid body motion simulation Force f
7
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Procedure of physics simulation 1. Find contact points 2. Calculate the contact forces 3. Update the positions and velocities Talk about this in detail next lesson
8
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 8 Taxonomy of physics simulator Computation Methods for constraint forces are not limited to Spring and Damper. Velocity based LCP is widely used. Havok Novodex ODE … reference : Kenny Erleben: Multibody Dynamics Animation Lecture 12 Department of Computer Science Copenhagen University Multi Body Dynamics simulator Analytical method Full coordinate method penalty method Impulse method Mirtich 96 Hahn 88 LCP based formularization Moore & Williams 89 Acceleration base Baraff 89 Velocity base Stewart 96 Jean Jacques Moreau method Reduced coordinate method Springhead1 Armstrong 79 Featherstone 83 OpenTissue ODE Springhead2
9
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 9 Rigid body motion equation Two objects + Restraint + External Force Many rigid bodies + constraints + external forces v j j rjrj riri v i i m j I j m i I i Inertia Velocity and Angular velocity Other external force, gravity Constraint force u M fcfc fefe
10
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 10 Constraint Examples Joint(Hinge) (Contacts are mentioned later) Only rotate the hinge axis e 3 : Rotate hinge axis e 3 freely = torque not work : w 2, 2 w 1 1 w 3 3 w 4 4 w 5 5 w 6 6 Constraint coordinate system e1e1 e2e2 e3e3 :relative velocity/angular velocity at the joint point :constraint forces and torques on the joint point force velocity force velocity w i j
11
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 11 Embed constraints into equation of motion Express equation of motion on the constraint coordinate. → use w, express w 2 w 3, w 5 w 6, with the same way Matrix expression of cross product v j, j rjrj riri v i, i u u w J row1 J row4 v i, i : velocity or angular velocity of object i in world coordinate. w: relative velocity and angular velocity of j from i in constraint coordinate
12
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 12 Embed constraints into equation of motion f j, j rjrj riri f i, i u velocity/angular of rigid body coordinate w velocity/angular velocity in constraint coordinate force/torque in constraint coordinate f c force/torque in world coordinate v i, i : velocity, angular velocity of object i v j, j : velocity, angular velocity of object j f j, j : constraint forces given from i to j in world coordinate j : constraint forces given from i to j in constraint coordinate v j, j rjrj riri v i, i w
13
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 13 Embed constraints Transform equation of motion to consider constraint easily Ally with constraint condition (hinge’s case) Solve the simultaneous equations Constraint : Substitute to equation of motion :
14
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 14 Simulation Procedure Calculate constraint force Update rigid body velocity Update rigid body position posture of all rigid bodies position orientation quaternion A matrix transforming velocity into Quaternion differential
15
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 15 Contact Constraint Contact Do not penetrate each other = is not zero when w is zero or is zero when w is not zero: Static friction or kinetic friction : Torque is 0 : relative velocity at joint point contact force on contact point velocity force velocity force velocity force
16
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 16 Embed Constraint (for contact) Transform motion equation to consider restraint easily Ally with constraint condition There are two variables in an equation at a glance, but actually solve one variable with consider the other variable as a constant. velocity force velocity force At first, solve this case and find i. If i does not satisfy w i = 0 then fix i to a constant and solve w i
17
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 17 Summary Velocity based LCP is widely used. Formulate constraints into velocity based LCP and find constraint force. Then do the stepping of the simulation Transform equation of motion of solids with Jacobian J → Equation of motion by and. Formulate constraints by equations of and and substitute it into equation of motion. → The equations come to LCP Solve LCP and find update velocity and position. Constraints Joints are lines, contacts are polylines. It looks there are two variables. But one of the variables comes to constant.
18
aselab 東工大長谷川 ( 晶 ) 研 18 Computation Simultaneous equations solution Approximate solution for LCP Error-correction method
19
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 19 How to Solve Simultaneous Equation Restraint included motion equation LCP : Linear Complementary Problem Solve LCP Pivoting method ・・・ strict slow speed Iterative method ・・・ high speed, precision depends on iteration number of times Matrix-splitting method Jacobi method Gauss–Seidel method, SOR method Newton's method two variable in one equation +complementary condition of i and i (one is a variable and the other is a constant )
20
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Matrix-splitting method A method to solve large simultaneous equations approximately with small computation amount. Choose D as a simple matrix such as diagonal matrix Jacobi method choose D as diagonal entries of A and choose F as the rest. Gauss-Seidel method is improved version of Jacobi method. 20 Gauss–Seidel method / SOR method If recurrence relation is converged, So This recurrence relation converge if A is positive symmetry matrix. Long narrow objects or objects with small inertia converge slow.
21
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 21 Gauss–Seidel method / SOR method Gauss–Seidel method SOR method Just accelerate Gauss–Seidel method slightly Converge quickly Jacobi method : update at once Gauss–Seidel method : update one row at one time renewed under renewing not-renewed 1.6times acceleration Gauss–Seidel method
22
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 22 LCP and Gauss–Seidel method Gauss–Seidel method renew one row at one time Can Calculate Contact force perfectly renewed under renewing not-renewed Do not invade each other = is not zero when ω is zero or is zero when ω is not zero: Static friction or kinetic friction : if 1 is renewed to a negative number, then let 1 Use renewed 1 to check “ 1 2 1 ”,if protrude, clip with 1 1
23
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 23 Simulation examples
24
Continuum simulation
25
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Continuum simulation Mass point Continuum Simulation is needed not only in time but also in space dimension. wave solid fluid Coil voltage t v t V x t Discretize Hooke‘s law and equation of motion
26
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Continuum simulation continuous →deal with limited representative points not infinity many methods for taking representative points Grid points in Euler coordinate system are representative points Common for fluid and wave surface simulation Grid do not move Mass come from surroundings and go out Grid points in Lagrange coordinate system are representative points Finite element method Grids move with mass Grids collapse or turn over under large deformation Particle method : representative points are particles Express mass with freely moving particles Large deformation is ok because of no assumption at beginnings Collision detection is important
27
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Finite Element Method Soft objects ( meat, jelly, human body )
28
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Soft objects cloth Mass point + Spring-damper model Omit parts of stress
29
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Fluid Liquid Gas
30
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Model what? Wave Particles
31
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 Model what? Vortex field of fluid
32
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 32 Speed and stability Rigid body stability is more important than speed The number of rigid bodies is almost enough Any simulation oscillates Guarantee control stability Havok FX example PD control oscillation example Wrotek et al. 2006
33
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 33 Speed and stability The speed of fluid is not fast enough 2D wave front→ sufficient real-time 3D mesh→ more difficult 3D particles → can not deal with many Combination is needed possibly A Fluid Resistance Map Method for Real-time Haptic Interaction with Fluids [Y. Dobashi et al. 2006] Efficient Simulation of Large Bodies of Water by Coupling Two- and Three-Dimensional Techniques [G. Irving et al. 2006] R Force feedback 圧力場・流速 (FRM :Fluid Resistance Map) 3D-fluid simulation Water speed Real-time Prior calculation Paddle speed Real-time wave simulation
34
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 High speed Soft objects which can be simulated are numerous Record and reproduce the deformation caused by impulse force Modal analysis based object deformation
35
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 35 Physics simulation applications Generate real motion Game physics Character motion Body simulation Connect real world and virtual world Aid recognition of real world Establish a virtual world which is able to be reproduced in the real world
36
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 36 Character motion Oshita 2001 Liu et al.2005 Optimize the overall trajectory ○ Advanced optimization △ Real-time generation is difficult Zordan et al. 2005, Zordan and Hodgins 2002, Natural Motion Endorphin controller + simulation. PD control the joint angles ○ Real-time generation △ controller generation acceleration, not torque Decide acceleration with PD control ← torque/ZMP limitation ○ PD adjustment is easy. △ motion based on external force
37
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 37 Character motion Transform motion-capture data PD control marker position of body model to captured-data position Record joint angles Joint torque and floor reaction force calculation PD control joints and reproduce motions Calculate active force came from joints and floor
38
aselab 東工大長谷川 ( 晶 ) 研 aselab 東工大長谷川 ( 晶 ) 研 38 Character motion Hasegawa et.al 2005 PD control the positions of joints and fingertips The World Force feedback Position of hands Physics simulator Virtual human’s mind action rule Motion Controller Reaching motion Default posture Simulator for prediction State transition Wait Guard Attack Force interface
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.