Beruflich Dokumente
Kultur Dokumente
Physics in Graphics
Ray-Tracing; Depth of Field; Motion Blur, etc
Rendering: Optics
Modeling: Mechanics
Not Wave Optics! Not Quantum Mechanics! Both Classical (17th ~ 18th Century optics and mechanics)
Simulation of Rigid Body Dynamics Some have springs. (Easier, So Real Time!)
Simulation of Fluid, Smoke, Elastic Body, Hair, Cloth, Explosion,Building Fracture, etc. (Lots of Computation, not real time)
http://www.youtube.com/watch?v=RxnRHIqefdU
http://youtu.be/LVbdBszrlxM
Particle Systems
WebGL Demos
http://www.liquidthought.com/sandbox/sandbox.html http://jarrodoverson.com/static/demos/particleSystem/ http://html5-pro.com/wormz/
xi (t + dt ) = xi (t ) + t v( xi (t ), t )
xi vi
mi
dvi d xi f i (t ) = mi ai (t ) = mi = mi 2 dt dt
Numerical Schemes
Forward (Explicit) Euler Method: Use current time step force and velocity
Backward(Implicit) Euler Method: Use future time step force and velocity
In your Code
Initiate the position, velocity and force for each particle object.
Calculate the force, for eg. constant gravity; Use the force to update the velocity; Use the velocity to update the position; Draw the ball on its position.
Collision Resolution
Collision Resolution
http://www.youtube.com/watch?v=J9HaT23b-xc
Start
In your code
Initiate the Center of mass, Moment of Inertia, Rotation, Velocity, Angular Velocity and Force on each rigid body.
Each Frame
Calculate Force and Torque (Need to solve for collision detection and collision handling) Update the Velocity and Angular Velocity Update the Position and Rotation Draw the object in position and rotation
Spring-Damper System
Demo Cloth, Hair 1D String
https://www.youtube.com/watch?v=45QxOhFpDSk Game Hair http://www.youtube.com/watch?v=ib1vmRDs8Vw Game Cloth http://www.youtube.com/watch?v=2FTpltiN4ig VFX Cloth
Spring-Damper System
Other Forces
Friction Force (stabilize the system)
Friction Force is typically proportional to the speed of the node Friction Factor
In your Code
First Init all the properties of nodes and spring-dampers Within Each Frame(Forward Euler Method)
Calculate and sum up all the forces Update the Velocity of nodes Update the Position of nodes Draw everything
Numerical Schemes
Forward (Explicit) Euler Method: Use current time step force and velocity
xi (t + dt ) = xi (t ) + vi (t ) * dt
Backward(Implicit) Euler Method: Use future time step force and velocity
Achieved by solving systems of partial differential equations Continuum mechanics define the equations. Apply advanced numerical methods to solve the equations (Finite Element Method) Eg: Terans virtual surgery.
http://www.youtube.com/watch?v=PTcLqyQO_4Q Smoke
Navier-Stokes Equations
u ( + u u ) + P = vu + g t
Others
Sound Simulation Fracture:
https://www.youtube.com/watch?v=gs93sKMYKRg https://www.youtube.com/watch?v=jlbdQHXDPRY
http://www.youtube.com/watch?v=nHH8N_lNZzI http://www.youtube.com/watch?v=hZC6ORUbLog