<p>The rigid body simulation is very similar to the point mass case except for
that we have to handle rotational motion (orientation and angular momentum).</p>

<p>In addition to common particle attributes such as mass, position, and linear velocity, we will need to store initial moment of inertia <span class="math-container">$\mathbf{\hat{I}}$</span>,
current angular momentum <span class="math-container">$\mathbf{L}^n$</span>, and current orientation <span class="math-container">$\mathbf{R}^n$</span>.
If you are using a data driven particle system, this step is as easy as declaring a few new attributes.</p>

<p>Contract to the mass, the moment of inertia at current time step <span class="math-container">$\mathbf{I}^n$</span> depends on the current orientation <span class="math-container">$\mathbf{R}^n$</span>: <span class="math-container">$\mathbf{I}^n=\mathbf{R}^n \mathbf{\hat{I}} (\mathbf{R}^n)^T$</span>.</p>

<p>The kinetic of a rigid body is analogous to the linear motion:
<span class="math-container">$$
\begin{align}
\dot{\mathbf{R}} &amp;= \omega^* \mathbf{R} \\
\frac{\mathbf{R}^{n+1} - \mathbf{R}^n}{\Delta t} &amp;= (\omega^{n*}) \mathbf{R}^n \\
\omega^n &amp;= (\mathbf{I}^n)^{-1} \mathbf{L}^n
\end{align}
$$</span>
where <span class="math-container">$\omega$</span> is the angular velocity and <span class="math-container">$\omega^*$</span> is the "cross product" matrix.</p>

<p>For dynamics, we also have a similar version of Newton's "f=ma":
<span class="math-container">$$
\frac{\mathbf{L}^{n+1} - \mathbf{L}^n}{\Delta t} = \tau^n
$$</span>
where <span class="math-container">$\tau$</span> is the torque.</p>

<p>Because there will be interactions between rigid spheres, you will also need to implement the collision detection for spheres.</p>

<p>Now we have known the kinematics and dynamics of rigids. The only thing left is how to solve (integrate) above equations. The naive forward Euler may not give stable result. A good introduction of this topic can be found at <a href="http://www.cs.cmu.edu/~baraff/sigcourse/index.html" rel="nofollow noreferrer">Witkin and Baraff SIGGRAPH course</a>, and here is an another more <a href="https://www.cs.ucr.edu/~shinar/papers/2018_introduction_to_pba.pdf" rel="nofollow noreferrer">recent SIGGRAPH course by Bargteil and Shinar</a>.</p>

CC BY-SA 4.0
2019-02-21T04:23:46.520Z
2019-02-26T21:46:41.207Z
2019-02-26T21:46:41.207Z
TheBusyTypist
<p>I am attempting to code a simple spring mass system simulation in which a sphere pendulus hangs from a string (a spring) by the top and then another sphere (controlled by the user) can move and interact (collide) with this hanging sphere.</p>

<p>I have already coded the dynamics of the spring part of the simulation, but I do not know enough to add the rigid body dynamics. I would like either an explanation or a source to understand how to algorithmicaly do this simulation.</p>

<physically-based><animation><simulation>
kinematics and dynamics of a sphere in a spring mass system?
Makogan
# kinematics and dynamics of a sphere in a spring mass system?

(Asked by: username_0 on 2018-03-13)

I am attempting to code a simple spring mass system simulation in which a sphere pendulus hangs from a string (a spring) by the top and then another sphere (controlled by the user) can move and interact (collide) with this hanging sphere.

I have already coded the dynamics of the spring part of the simulation, but I do not know enough to add the rigid body dynamics. I would like either an explanation or a source to understand how to algorithmicaly do this simulation.

**Tags:** physically-based, animation, simulation


---

## 1 answers

### Answer by username_1 on 2019-02-21. Score: 1 | Accepted answer

The rigid body simulation is very similar to the point mass case except for
that we have to handle rotational motion (orientation and angular momentum).

In addition to common particle attributes such as mass, position, and linear velocity, we will need to store initial moment of inertia $\mathbf{\hat{I}}$,
current angular momentum $\mathbf{L}^n$, and current orientation $\mathbf{R}^n$.
If you are using a data driven particle system, this step is as easy as declaring a few new attributes.

Contract to the mass, the moment of inertia at current time step $\mathbf{I}^n$ depends on the current orientation $\mathbf{R}^n$: $\mathbf{I}^n=\mathbf{R}^n \mathbf{\hat{I}} (\mathbf{R}^n)^T$.

The kinetic of a rigid body is analogous to the linear motion:
$$
\begin{align}
\dot{\mathbf{R}} &= \omega^\* \mathbf{R} \\
\frac{\mathbf{R}^{n+1} - \mathbf{R}^n}{\Delta t} &= (\omega^{n\*}) \mathbf{R}^n \\
\omega^n &= (\mathbf{I}^n)^{-1} \mathbf{L}^n
\end{align}
$$
where $\omega$ is the angular velocity and $\omega^\*$ is the "cross product" matrix.

For dynamics, we also have a similar version of Newton's "f=ma":
$$
\frac{\mathbf{L}^{n+1} - \mathbf{L}^n}{\Delta t} = \tau^n
$$
where $\tau$ is the torque.

Because there will be interactions between rigid spheres, you will also need to implement the collision detection for spheres.

Now we have known the kinematics and dynamics of rigids. The only thing left is how to solve (integrate) above equations. The naive forward Euler may not give stable result. A good introduction of this topic can be found at [Witkin and Baraff SIGGRAPH course](http://www.cs.cmu.edu/~baraff/sigcourse/index.html), and here is an another more [recent SIGGRAPH course by Bargteil and Shinar](https://www.cs.ucr.edu/~shinar/papers/2018_introduction_to_pba.pdf).


---

