当前位置:   article > 正文

基于物理的建模与动画 Chapter One - Three_基于物理的建模与动画 pdf

基于物理的建模与动画 pdf

本书以 基于物理的建模与动画(Foundations of Physically Based Modeling and Animation) 为textbook

Chapter One. Introduction

four parts

  1. fundmental
    Chapter One - Three
  2. paritcles
    Chapter Four - Eight
  3. rigid body dynamics
    Chapter Nine - Twelve
  4. simulation of fluid
    Chapter Thirteen = Fifteen

Chapter Two. Model & Simulation

Euler method

Chapter Three. Collision & elastic sphere

3.1 collision process

  1. collision detection
    whether collide or not
  2. collision determination
    when and where collide occured
  3. collision response
    effect of collision
3.1.1 collision detection

For a point ( x 0 , y 0 , z 0 ) (x_0, y_0, z_0) (x0,y0,z0) and a plane A x + B y + C z = 0 Ax + By + Cz = 0 Ax+By+Cz=0, we can use the value of P ( x 0 , y 0 , z 0 ) = A x 0 + B y 0 + C z 0 P(x_0, y_0, z_0) = Ax_0 + By_0 + Cz_0 P(x0,y0,z0)=Ax0+By0+Cz0 to determine which side the point belongs.

Another common method is to use normal vector n ^ = [ n x   n y   n z ] T \hat{n} = [n_x\ n_y\ n_z]^T n^=[nx ny nz]Tand a point p ( p x , p y , p z ) p(p_x,p_y,p_z) p(px,py,pz) on the plane.
These variables can construct a plane like n x x + n y y + n z z − n ^ ⋅ p = 0 n_x x + n_y y + n_z z - \bm{\hat{n}} \cdot \bm{p} = 0 nxx+nyy+nzzn^p=0, or in concise terms ( x − p ) ⋅ n ^ = 0 (\bm{x} - \bm{p}) \cdot \bm{\hat{n}} = 0 (xp)n^=0
The projection distance from point to plane can be got by d = ( x − p ) ⋅ n ^ d = (\bm{x} - \bm{p}) \cdot \bm{\hat{n}} d=(xp)n^

3.1.2 collision determination

The following is got by Euler method
We use d [ n ] d^{[n]} d[n] denotes the projection distance timestep begins, and d [ n + 1 ] d^{[n+1]} d[n+1] denotes timestep ends.
We suppose that the velocity is constant in the duration.(Euler method)
So we can get the timestep fraction f = d [ n ] d [ n ] − d [ n + 1 ] f = \frac{d^{[n]}}{d^{[n]} - d^{[n + 1]}} f=d[n]d[n+1]d[n],
and the timestep when the collision occurs in this turn is f h fh fh.
Using this,we get the new state and calculate the remain timestep.

pseudo code:
h is timestep, n is step, t is current time, s is state

s = s0, n = 0, t = 0;
while t < tmax do
{
	TimestepRemaining = h;
	Timestep = TimestepRemaining;
	while TimestepRemaining > 0
	{
		s_deriv = GetDeriv(S);
		s_new = Intergate(s, s_deriv, Timestep);
		if CollisionBetween(s, s_new)
		{
			calcuate f;		// f means timestep fraction
			Timestep_collision = f * Timestep;
			s_new = Intergate(s, s_deriv, Timestep_collision);
			CollisionResponse(s_new);
		}
		TimestepRemaining = TimestepRemaining - Timestep;
		s = s_new;
	}
	n = n + 1, t = n * h;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
3.1.3 collision response

In this chapter, we simplify the siutuation and suppose there is no rotation and the plane is infinite.
The collision response can be devided two parts, elasticity & friction.Here we use − \bm{^{-}} to denote the state before collision, + \bm{^{+}} + to denote the state after collision.
From the sumption, we know x − = x + x^{-} = x^{+} x=x+, and we want to get v + v^{+} v+ from v − v^{-} v
Let n ^ \bm{\hat{n}} n^ denote the normal factor, we know v n − = ( v − ⋅ n ^ ) n ^ , v t − = v − − v n − \bm{v_n^{-} }= (\bm{v^{-}} \cdot \bm{\hat{n}}) \bm{\hat{n}}, \bm{v_t^{-}} = \bm{v^{-}} - \bm{v_n^{-}} vn=(vn^)n^,vt=vvn

3.1.3.1 elasticity

coefficient of restitution c r c_r cr
v n + = − c r v n − = − c r ( v − ⋅ n ^ ) n ^ \bm{v_n^{+}} = -c_r\bm{v_n^{-}} = -c_r(\bm{v^{-}} \cdot \bm{\hat{n}}) \bm{\hat{n}} vn+=crvn=cr(vn^)n^

3.1.3.2 friction

coefficient of friction c f c_f cf
v t + = ( 1 − c f ) v t − = ( 1 − c f ) ( v − − v n − ) \bm{v_t^{+}} = (1 - c_f) \bm{v_t^{-}} = (1 - c_f) (\bm{v^{-}} - \bm{v_n^{-}} ) vt+=(1cf)vt=(1cf)(vvn)
Another point to be considerated is the bound of v t + ⩾ 0 \bm{v_t^{+}} \geqslant 0 vt+0
v t + = v t − − m i n ( μ ∣ ∣ v n − ∣ ∣ , ∣ ∣ v t − ∣ ∣ ) v t − ^ \bm{v_{t}^{+}} = \bm{v_{t}^{-}} - min(\mu||\bm{v_{n}^{-}}||, ||\bm{v_{t}^{-}}||) \hat{\bm{v_{t}^{-}}} vt+=vtmin(μvn,vt)vt^

then we can get the final v + = v n + + v t + \bm{v^{+}} = \bm{v_{n}^{+}} + \bm{v_{t}^{+}} v+=vn++vt+

3.2 Bouncing ball

The problem we face in this stage is numberical precision & resting condition.

3.2.1 numerical precesion

a useful method is to avoid round-off error is tolerance.
a − b = 0 ⇒ a > b − ϵ a - b = 0 \Rightarrow a \gt b - \epsilon ab=0a>bϵ & a < b + ϵ a \lt b + \epsilon a<b+ϵ
a > b ⇒ a − b > ϵ a \gt b \Rightarrow a - b \gt \epsilon a>bab>ϵ
a < b ⇒ a − b < − ϵ a \lt b \Rightarrow a - b \lt -\epsilon a<bab<ϵ

While tolerance still has two limitis.

  1. First, it’s difficult to find a good enough number, which not only captures all the error, but also doesn’t cause misjudgment of equality.
  2. The second problem is incidence intransitivity.
    a = b a = b a=b & b = c b = c b=c may not reach a conclusion that a = c a = c a=c
3.2.2 resting condition

Four steps:

  1. ∣ ∣ v ∣ ∣ < ϵ 1 ||\bm{v}|| \lt \epsilon_1 v<ϵ1
  2. whether there is a plane to make d < ϵ 2 d \lt \epsilon_2 d<ϵ2 or not
  3. F ⋅ n ^ < ϵ 3 \bm{F} \cdot \bm{\hat{n}} \lt \epsilon_3 Fn^<ϵ3
    here F F F is the total force, n ^ \bm{\hat{n}} n^ is normal vector
  4. ∣ ∣ F t ∣ ∣ < μ ∣ ∣ F n ∣ ∣ ||\bm{F_t}|| \lt \mu ||\bm{F_n}|| Ft<μFn

However, in complex simulations, it’s a NP-complete problem to calculate accurately.More content is in Chapter Nine.

3.3 Polygonal geometry

The actual situation is that the plane is finite.
A plane can be uniquely represented by normal vector n ^ \bm{\hat{n}} n^ and a point p \bm{p} p on plane.
n ^ = ( p 1 − p 0 ) ∗ ( p 2 − p 0 ) ∣ ∣ ( p 1 − p 0 ) ∗ ( p 2 − p 0 ) ∣ ∣ \bm{\hat{n}} = \frac{(\bm{p}_1 - \bm{p}_0) * (\bm{p}_2 - \bm{p}_0)}{||(\bm{p}_1 - \bm{p}_0) * (\bm{p}_2 - \bm{p}_0)||} n^=(p1p0)(p2p0)(p1p0)(p2p0)
Let p = p 0 \bm{p} = \bm{p}_0 p=p0 ( p 0 \bm{p}_0 p0 is a point on the plane, or vertex of polygonal geometry particularly)
The distance from point x \bm{x} x to the plane can be represented by
d = ( x − p ) ⋅ n ^ d = (\bm{x} - \bm{p}) \cdot \bm{\hat{n}} d=(xp)n^
All the point on the plane satisfy ( x − p ) ⋅ n ^ = 0 (\bm{x} - \bm{p}) \cdot \bm{\hat{n}} = 0 (xp)n^=0

fault

3.3.1 P31 tolerance ϵ \epsilon ϵ, a − b > ϵ a - b \gt \epsilon ab>ϵ

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/904618
推荐阅读
相关标签
  

闽ICP备14008679号