Cloth collision detectionWhat is the currnt stateof the art
Cloth collision detectionWhat is the currnt stateof the art
Hi all,
I am trying to find the current state of the art in cloth collision detection either GPU or CPU. I have seen this(http://wwwevasion.imag.fr/Publications ... HRFCFMS04/) Eurographics report and this thesis(http://www.mpiinf.mpg.de/~bargmann/doc ... tion_S.pdf) but they seem quite old.
Does anyone have any new pointers? possibly using GPU/openCL/CUDA whatever?
I am trying to find the current state of the art in cloth collision detection either GPU or CPU. I have seen this(http://wwwevasion.imag.fr/Publications ... HRFCFMS04/) Eurographics report and this thesis(http://www.mpiinf.mpg.de/~bargmann/doc ... tion_S.pdf) but they seem quite old.
Does anyone have any new pointers? possibly using GPU/openCL/CUDA whatever?
Re: Cloth collision detectionWhat is the currnt stateof the
I was just at the OpenCL site the other day, and I think they have an example program for cloth simulation, but I didn't note if it involved collision.
 Erwin Coumans
 Site Admin
 Posts: 4183
 Joined: Sun Jun 26, 2005 6:43 pm
 Location: California, USA
 Contact:
Re: Cloth collision detectionWhat is the currnt stateof the
What collision shapes do you want the cloth to collide against?
For gaming purposes, I can imagine the following combinations would be useful:
A) cloth against cloth (and self collision)
B) cloth against convex shape
C) cloth against concave triangle meshes
We have some discrete GPU collision detection for convex shapes, that can also be used for cloth against convex. It let you query a point against a convex shape, and it returns the penetration depth/normal/location. Would that be of any use for you?
Thanks,
Erwin
For gaming purposes, I can imagine the following combinations would be useful:
A) cloth against cloth (and self collision)
B) cloth against convex shape
C) cloth against concave triangle meshes
We have some discrete GPU collision detection for convex shapes, that can also be used for cloth against convex. It let you query a point against a convex shape, and it returns the penetration depth/normal/location. Would that be of any use for you?
Thanks,
Erwin

 Posts: 55
 Joined: Sun Jan 01, 2012 7:37 pm
Re: Cloth collision detectionWhat is the currnt stateof the
The issue is still up that cloth does not self collide.
Shouldn't that be updated on google code if it is the case?
Shouldn't that be updated on google code if it is the case?
Re: Cloth collision detectionWhat is the currnt stateof the
HI Erwin,
Thanks for the reply. Well I wanted to see what has been done in collision detection for cloth
this includes collision with concave and convex meshes as well as self collision and collision between two clothes. I wanted to see what is the state of the art in this.
Thanks for the reply. Well I wanted to see what has been done in collision detection for cloth
this includes collision with concave and convex meshes as well as self collision and collision between two clothes. I wanted to see what is the state of the art in this.
Re: Cloth collision detectionWhat is the currnt stateof the
There is also the method : Optimized Spatial Hashing for Collision Detection of Deformable Objects that is used in Position Based Dynamics for cloth simulation.
 Erwin Coumans
 Site Admin
 Posts: 4183
 Joined: Sun Jun 26, 2005 6:43 pm
 Location: California, USA
 Contact:
Re: Cloth collision detectionWhat is the currnt stateof the
A promising approach is Efficient Geometrically Exact Continuous Collision Detection by T. Brochu, E. Edwards, and R. Bridson, Proc. SIGGRAPH 2012.
It is opensource code and I made a fork that compiles on Windows, Linux and Mac OSX here:
https://github.com/erwincoumans/experim ... /exactccd
It is opensource code and I made a fork that compiles on Windows, Linux and Mac OSX here:
https://github.com/erwincoumans/experim ... /exactccd
Re: Cloth collision detectionWhat is the currnt stateof the
I've been rewriting a lot of the Bullet softbody collision code redoing the vertexface collision detection, adding edgeedge detection, supporting selfcollision with the same, and sprinkling it with multithreading.
Like the Brochu et al. paper I do the constant velocity approximation. I initially tried the approach of solving the cubic, but that proved to be too unstable and too slow. Instead I approximated it to a quadratic.
For example, the vertexface case is equivalent to determining when the plane of the face moves through the origin (by considering everything relative to the vertex). As all the vertices are moving linearly, this is normally a cubic problem as the normal direction (nonnormalised) of the plane changes cubically over time. But for small timesteps the cubic term of the normal direction turns out to be very small compared to the other terms (one reason why solving the cubic tends to be unstable). So I drop it and solve the resulting quadratic.
I should note that I use fairly small timesteps compared with typical Bullet use, such as 1/180th of a second.
The results look quite similar to the ones presented in the paper, with cloth stacking up on itself without selfintersecting.
I do find that I still need to have a collision margin to avoid vertices from switching sides when sliding over a surface, but it is very small (I default to a few millimetres). I haven't figured out a good and cheap way of keeping track of which side of the (often not closed) surface each vertex should remain while sliding.
JvdL
Like the Brochu et al. paper I do the constant velocity approximation. I initially tried the approach of solving the cubic, but that proved to be too unstable and too slow. Instead I approximated it to a quadratic.
For example, the vertexface case is equivalent to determining when the plane of the face moves through the origin (by considering everything relative to the vertex). As all the vertices are moving linearly, this is normally a cubic problem as the normal direction (nonnormalised) of the plane changes cubically over time. But for small timesteps the cubic term of the normal direction turns out to be very small compared to the other terms (one reason why solving the cubic tends to be unstable). So I drop it and solve the resulting quadratic.
I should note that I use fairly small timesteps compared with typical Bullet use, such as 1/180th of a second.
The results look quite similar to the ones presented in the paper, with cloth stacking up on itself without selfintersecting.
I do find that I still need to have a collision margin to avoid vertices from switching sides when sliding over a surface, but it is very small (I default to a few millimetres). I haven't figured out a good and cheap way of keeping track of which side of the (often not closed) surface each vertex should remain while sliding.
JvdL
Re: Cloth collision detectionWhat is the currnt stateof the
Do you mind sharing how you handle the edgeedge case? My version is atrocious, but basically works.
Re: Cloth collision detectionWhat is the currnt stateof the
Edge versus edge can actually be transformed to be similar to vertex versus face.
In short, vertex versus face with linearly moving vertices is done by:
Compute the plane equation for that quadrilateral, and now you have a vertex versus plane problem just like with vertexface.
Solve as before (steps 2 and 3) to get the potential collision times, and check each time with a full edge versus edge intersection test. And yes, this last step does have an annoying number of cases to check with some care needed for numeric stability.
Some care also has to be taken when computing the plane equation due to degeneracies, for example if the two edges are parallel at the start or end of the time interval.
I then put the resulting edgeedge collision data in an array similar to what SContact is for vertexface, and process it in btSoftBody::PSolve_SContacts().
JvdL
In short, vertex versus face with linearly moving vertices is done by:
 Convert to vertex versus plane by determining the plane equation for the face
 Convert to origin versus plane by considering the problem relative to the vertex
 Solve the resulting cubic equation, or use the quadratic approximation, to get the potential collision time values
 Check each potential collision time for actual collision by evaluating the vertex positions at those times and doing a vertex inside/outside face check
Compute the plane equation for that quadrilateral, and now you have a vertex versus plane problem just like with vertexface.
Solve as before (steps 2 and 3) to get the potential collision times, and check each time with a full edge versus edge intersection test. And yes, this last step does have an annoying number of cases to check with some care needed for numeric stability.
Some care also has to be taken when computing the plane equation due to degeneracies, for example if the two edges are parallel at the start or end of the time interval.
I then put the resulting edgeedge collision data in an array similar to what SContact is for vertexface, and process it in btSoftBody::PSolve_SContacts().
JvdL
Re: Cloth collision detectionWhat is the currnt stateof the
Aha! That's the trick I was missing. Thanks for the idea!jarno wrote:The edge versus edge case can be converted to a vertex versus plane problem by collapsing one edge to a point, and extruding the other edge in the same direction to form a quadrilateral.
Re: Cloth collision detectionWhat is the currnt stateof the
Hi jarno,
Do you have any intention to contribute your implementation back to bullet physics?
Regards.....
Do you have any intention to contribute your implementation back to bullet physics?
Regards.....
jarno wrote:I've been rewriting a lot of the Bullet softbody collision code redoing the vertexface collision detection, adding edgeedge detection, supporting selfcollision with the same, and sprinkling it with multithreading.
Like the Brochu et al. paper I do the constant velocity approximation. I initially tried the approach of solving the cubic, but that proved to be too unstable and too slow. Instead I approximated it to a quadratic.
For example, the vertexface case is equivalent to determining when the plane of the face moves through the origin (by considering everything relative to the vertex). As all the vertices are moving linearly, this is normally a cubic problem as the normal direction (nonnormalised) of the plane changes cubically over time. But for small timesteps the cubic term of the normal direction turns out to be very small compared to the other terms (one reason why solving the cubic tends to be unstable). So I drop it and solve the resulting quadratic.
I should note that I use fairly small timesteps compared with typical Bullet use, such as 1/180th of a second.
The results look quite similar to the ones presented in the paper, with cloth stacking up on itself without selfintersecting.
I do find that I still need to have a collision margin to avoid vertices from switching sides when sliding over a surface, but it is very small (I default to a few millimetres). I haven't figured out a good and cheap way of keeping track of which side of the (often not closed) surface each vertex should remain while sliding.
JvdL