Reviewing cloth simulation and deformable objects, we simulate a deformation from reference X to world space x as
Δx≈F∂X∂xΔX
so that we can have the strain
ΔxTΔx−ΔXTΔX=ΔXFTFΔX−ΔXTΔX=ΔXT(FTF−I)ΔX
where FTF−I is the Green Lagrange Strain.
For a rigid object, the object cannot be deformed so that FTF−I=0⇒FTF=I⇒F∈O(3), i.e. F is an orthogonal matrix. For common 3D transformations, rotation matrices and reflection matrices are both orthogonal. However, reflection will have the object's topology passing through itself, which is not rigid.
Therefore, we limit F∈SO(3), i.e. rigid bodies can only rotate, and SO(3) is called the special orthogonal Group,
∀R∈SO(3).RT=R−1∧det(R)>0
In addition, rigid bodies can translate. Therefore, we have the rigid transformation from reference to world space as
x(X,t)=R(t)X+p(t)
x,X∈R3, R∈SO(3) is the rotation and p∈R3 is the translation (often written in t but we don't want this to be confused with time t).
Generalized Coordinates
Consider the mapping
x(X,t)=R(t)X+p(t)
clearly, only R,p is about time, so that our generalized coordinates is
q={R,p}
Note that q is a set instead of a unified stacked vector.
Generalized Velocity
Consider the time derivative of the transformation on a single point
p(t)˙ is called the linear velocity since it's just the velocity of the origin of the object moves, R(t)˙ is the time derivative of rotation matrix, and it's more complex, we can represent it with
Note that M0 is an integral over the volume, naturally, we can use tetrahedral mesh so that we can do this integral. However, a more efficient method will use only the surface mesh.
Divergence Theorem states that
∫V∇f(X)dV=∫Af(X)⋅ndA
so that we can turn a volume integral to a surface integral Therefore, consider the entries of M0
Since V=0, we have L=T so that the Euler-Lagrange Equation gives Newton-Euler Equations
Conservation of Angular Momentum
(RIRT)ω˙=ω×((RIRT)ω)+τext
Where ω˙ is the angular acceleration, τext is the external torque and ω×((RIRT)ω) is the quadratic velocity vector 2. Conservation of Linear Momentum
mIp¨=fext
where p¨ is the acceleration and fext is the external force.
External Torques and Forces
For a force applied to some position x as f(x), this will result in a rotation as well as a translation. Note that
v(Xˉ,t)=R[[X]×TI][RT00RT][ωp˙]
Let J∈R3×6=R[[X]×TI][RT00RT] be the rigid body Jacobian matrix, which converts the generalized velocity to the velocity on some point
v(Xˉ,t)=Jq˙
Therefore, given x in the world space, we first inverse it back to reference space w.r.t. the center-of-mass
Xˉ=RT(x−p)−C
and then we can compute f(Xˉ) and J(Xˉ) so that
(τextfext)=J(Xˉ)Tf(Xˉ)
Time Integration
The NE Equations are 2 second order ODEs, and they are not inter-related. Therefore, we can derive update equations independently.
Update on Translation
The update for linear momentum is simple. Note that this is just the translation of the center of mass, we can think this as the update of the point mass, the rule is simply
mp˙t+1pt+1=mp˙t+Δtfext=pt+Δtp˙t
Update on Rotation
For the angular velocity update, we can simply using the Forward Euler, i.e. approximate
ω˙=Δt−1(ωt+1−ωt)
so that the update is
(RIRT)ωt+1=(RIRT)ωt+Δtωt×((RIRT)ωt)+Δtτextt
However, when we update the rotation, we cannot simply use the xt+1=xt+ΔtvT, since this will destroy the orthogonality. Alternatively, we can view this as solving an initial value problem.
dtx=vt,x(t0)=xt
integrating yields that
dtx∫t0t1dxx(t)=vt=∫t0t1vtdt=vtΔt+xt
With this, we can view vt as the velocity of rotation around p so that