Cloth simulation 4 - spheres in net

3,206 views · Published 22 September 2010 · 1:42 · Indexed 11 October 2026

Channel: Paul Nathan · 2010 · Science & Technology

Watch on YouTube

Same code as video 3, but with improved collision detection algorithm based on collision time rather than on distance between centres. In my implementation, if the time step to a collision event between any two spheres is less than the global time step, then assume that the collision is already taking place. This eliminates the problem of intersection and sticking of the spheres (at the slight expense of accuracy, but this can be improved by using a smaller time step, as always). The collision time step is formulated assuming constant velocity through a time step. This may not be so true when the accelerations are high (such as just after a collision), and so a distance check is employed as a secondary criterion in case the collision time check fails. I have derived a collision time that takes into account the acceleration of the spheres, but the equation is a quartic.... not so nice to find the desired root (smallest positive real) as with the simpler quadratic. A future upgrade....
Also, I have implemented Z-ordering for the large spheres, so they are rendered in the correct order (painter's algorithm - draw furthest objects first such that they are overdrawn by the closer objects). However the cloth nodes are not included in the Z-ordering yet....
All coded in VB.NET from scratch.

More from this channel