## Wednesday, August 6, 2008

### Physics and polyhedra

Thanks to my fellow physicist, Oleg Matveychuk, I've done with the collision handler bug I said in the last status report. That was indeed a mistake in the paper (Collision Detection and Response for Computer Animation).

One of the collision equation in that paper looks like

$(v_2+\omega_2\times\rho_2-v_1-\omega_1\times\rho_1)\cdot k=0.$

Here, $v_i$ is linear and $\omega_i$ is angular velocity of each of two bodies, $\rho_i$ is the vector pointing from center of mass to collision point, and $k$ is normal to collision plane. The expression in parens, let's call it $V$, is relative velocity of collision points of two bodies. So, Moore and Wilhelms propose to set $V$ to 0.

It appears that this corresponds to completely unelastic collision (with restitution coefficient equal to 0), and that's why it doesn't look too realistic.

If we have coefficient of restitution $\alpha$, then proper equation is $V'=\alpha V$, where $V'$ is taken after collision and $V$ before.

Another thing I've done is support of generic polyhedra. For example, now we can experiment not just with cubes, but with parallelepipeds or tetrahedra. And in future this will help us to handle arbitrary shapes by approximating them with polyhedra, using point repulsion algorithm which I'm going to implement (it's also needed for semi-adjusting BSP trees).

#### 1 comment:

chak said...

Always good to have a physicist close by!