Page 1 of 1

Position based dynamics collisions

Posted: Sat Aug 30, 2008 2:51 am
by Enigma
Hi there,

I'm currently implementing a version of the Position Based Dynamics paper by Mueller. However, I'm having some problems with the collision constraint they're using ( C = q*n - h ), mainly that I'm apparently somewhat mixed up in my hand and just can't manage to find the correct gradients for the function.

For the single vertex it's pretty obvious that the gradient is the normal of the triangles, however the gradients of the triangle vertices are not so clear. I tried calculating them but somehow I always mess up somewhere (i.e. it doesn't match numerically calculated gradients I'm using for testing).

It would be great if someone could help me out on this.

Re: Position based dynamics collisions

Posted: Sat Aug 30, 2008 4:54 am
by Nathanael
You could try to express the position in triangle as barycentric coordinate let say: P0*u+P1*v+P2*(1-u-v)
then your triangle gradients simply become :
[ -N*u , -N*v , -N*(1-u-v) ]
(based on C=(q-(P0 u + P1 v + P2 (1-u-v))).N )

Hope its work and help,
Nathanael.

Re: Position based dynamics collisions

Posted: Sat Aug 30, 2008 7:08 pm
by Enigma
D'oh, I knew this would end up being something absolutely easy. Thank you so much, works just like it's supposed to :-)

Re: Position based dynamics collisions

Posted: Mon Nov 17, 2008 2:58 pm
by che
Is thi paper of Muller (position based dynamics) implemented somewhere in the bullet source code ?