<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/577" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2013-09-16T13:18:46+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/577</id>

		<entry>
		<author><name><![CDATA[strangelet]]></name></author>
		<updated>2013-09-16T13:18:46+00:00</updated>

		<published>2013-09-16T13:18:46+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31738#p31738</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31738#p31738"/>
		<title type="html"><![CDATA[Conservation of linear and angular momentum]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=31738#p31738"><![CDATA[
Article from Müller about position based dynamics says that correcting/moving particles in direction of the gradient of the constraint function conserves linear and angular momentum. Could pls someone help me explain that? I don't see it.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9200">strangelet</a> — Mon Sep 16, 2013 1:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flyingwaffle]]></name></author>
		<updated>2007-11-15T15:20:22+00:00</updated>

		<published>2007-11-15T15:20:22+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6369#p6369</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6369#p6369"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6369#p6369"><![CDATA[
Yea, I hadn't realized at first that projecting using the Constraint gradient formula was an approximation (we're doing a newton-raphson step)<br>The main assumption is<br>C(p+Dp) ~ C(p) + Grad(C(p)).Dp = 0<br>so<br>applying <br>Dp_i = - C(p) Grad_i(C(p))/[Sum_i |Grad_i(C)|^2]<br>*once* isn't enough to satisfy the constraint (by an epsilon) if the penetration is significant (although in the case of the length constraint it works, it's all linear).<br>Is that correct?<br><br>I worked with the vertex/triangle collision constraint <br>C = ( q - p1 ) . (( p2-p1)X(p3-p1))<br>or rather its 2D version<br>C = (q-p1) . (1z X (p2-p1))      (1z coming out of the page)<br><img src="http://img65.imageshack.us/img65/862/pic4po8.png" class="postimage" alt="Image"><br>  <br>I get <br>grad_q (C) = 1z X (p2-p1)   (q moves down in the direction of the normal of p1p2)<br>grad_p1 (C) = 1z X (q-p2)   (p1 moves in the direction of the normal of qp2)<br>grad_p2 (C) = 1z X (p1-q)   (p2 moves in the direction the normal of qp2)<br>the projections are (unless I made some error... I wish <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<br>dq = - (q-p1).(1z X p12)  (1z X p12)<br>       -------------------------------<br>         |p12|^2 + |qp1|^2 + |qp2|^2<br><br>dp2 = - (q-p1).(1z X p12)  (1z X (qp1))<br>       -------------------------------<br>         |p12|^2 + |qp1|^2 + |qp2|^2<br><br>dp1 = - (q-p1).(1z X p12)  (1z X (p2q))<br>       -------------------------------<br>         |p12|^2 + |qp1|^2 + |qp2|^2<br><br>if q is close to the segment p1p2, q moves along the normal of p1p2 and p1 &amp; p2 almost move along the normal as well, but a bit towards q (1z x p2q ~ 1z X p1p2 ).<br><br><img src="http://img530.imageshack.us/img530/1107/pic1px4.jpg" class="postimage" alt="Image"><br><br>But if q, p1 and p2 form a equilateral triangle with side 1 (admittedly a very extreme case of collision).<br>       <br>each vertex moves toward the center of the triangle, by the same distance (sqrt(3)/6 along the normal)<br><img src="http://img260.imageshack.us/img260/2871/pic2la8.jpg" class="postimage" alt="Image">     <br>          <br>And projecting repeatedly such a collision constraint doesn't help (I guess you'd have to apply it once, then project the length constraints, project the collision constraint again, etc...).<br><br>My point with all this is that it's quite different from what Jakobsen is doing, where he moves the vertices all in the same direction qp (with some weighing based on geometry (ratio p1-p and p2-p):<br><br> <img src="http://img522.imageshack.us/img522/7046/jakyt6.jpg" class="postimage" alt="Image"><br><br>in the case q and p1p2 all belong to rigid non static bodies, he just says to move them along some point between q and p, but not where that point lies.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2091">flyingwaffle</a> — Thu Nov 15, 2007 3:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raigan2]]></name></author>
		<updated>2007-11-12T11:01:23+00:00</updated>

		<published>2007-11-12T11:01:23+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6323#p6323</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6323#p6323"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6323#p6323"><![CDATA[
If you need the actual position where the two contact points will be, the only way to get this (as far as I can tell) is to use the projection formula to project the point. I may be missing something however..<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=748">raigan2</a> — Mon Nov 12, 2007 11:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flyingwaffle]]></name></author>
		<updated>2007-11-12T00:43:34+00:00</updated>

		<published>2007-11-12T00:43:34+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6319#p6319</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6319#p6319"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6319#p6319"><![CDATA[
ok, I guess you mean finding how to project<br>c(q,p1,p2,p3)=(q-p1).[(p2-p1)X(p3-p1)]<br>thanks<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2091">flyingwaffle</a> — Mon Nov 12, 2007 12:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raigan2]]></name></author>
		<updated>2007-11-11T22:46:40+00:00</updated>

		<published>2007-11-11T22:46:40+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6317#p6317</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6317#p6317"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6317#p6317"><![CDATA[
If you read the "Position Based Dynamics", they actually present the solution for collision between a particle and an edge/triangle, that should do exactly what you want.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=748">raigan2</a> — Sun Nov 11, 2007 10:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flyingwaffle]]></name></author>
		<updated>2007-11-11T22:05:19+00:00</updated>

		<published>2007-11-11T22:05:19+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6316#p6316</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6316#p6316"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6316#p6316"><![CDATA[
Hello, I'm new to these boards... <br>After spending a couple of years implementing a physics engine based on the Barraff papers (it took me a really long time to get rid of numerical instabilities), I'm trying to implement the position based solution presented in this paper and Jakobsen's original paper.<br><br>I'm mostly interested in applying it to rigid bodies.<br><br>About that, Jakobsen mentions <br><br>"Here, we have collided a single rigid body with an immovable world. The above method generalizes to handle collisions of several rigid bodies. The collisions are processed for one pair of bodies at a time. Instead of moving only p, in this case both p and q are moved towards each other."<br><br>but he doesn't explain by how much should each rigid bodies should be moved to correct the constraint (somewhere between p and q).<br><br>For example if a node (at p) of body_1 penetrates a triangle of body_2 (p1, p2, p3), at point q, we should correct p by moving it along the normal of p1_2_3, toward q, and we should move p2, p3, p4 as well (from q toward p, correcting each node p1, p2, p3 proportionally). But where between p and q should be final correction?<br>Is this something that I can automatically derive with the constraint gradient technique?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2091">flyingwaffle</a> — Sun Nov 11, 2007 10:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Antonio Martini]]></name></author>
		<updated>2007-11-10T19:58:41+00:00</updated>

		<published>2007-11-10T19:58:41+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6308#p6308</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6308#p6308"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6308#p6308"><![CDATA[
<blockquote class="uncited"><div>Here's a quick test; for some reason (e) makes things unstable (adds energy), quite possibly an implementation error. The PBD formula is definitely better than the one I've been using, and using Q the Kalman method converges even better. </div></blockquote>i have just managed to run the code you posted, Q in fact seems to make a noticeable difference. <br><br>cheers,<br>Antonio<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=145">Antonio Martini</a> — Sat Nov 10, 2007 7:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Antonio Martini]]></name></author>
		<updated>2007-10-27T17:06:24+00:00</updated>

		<published>2007-10-27T17:06:24+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6113#p6113</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6113#p6113"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6113#p6113"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>I think I'm a bit confused about row and column vectors; K is definitely a column vector, as is X, but is J a row vector? If so, this would mean that K*J is an outer product, which would explain my problems as I assumed it was an inner product. Initially I just assumed everything what whatever was necessary to turn all of the multiplications into inner products <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"></div></blockquote></div></blockquote>yes you are correct J is a row vector if you have only one constraint.<br><br>in general the number of rows of J is the same as the number of contraints, the number of columns is the same as the number of degrees of freedom, 6 for a edge constraint or 2 row vectors of size 3 if written in block form. I think i have written the Jacobian for the edge constraint in the other thread.<br><br>cheers,<br>Antonio<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=145">Antonio Martini</a> — Sat Oct 27, 2007 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raigan2]]></name></author>
		<updated>2007-10-27T15:15:40+00:00</updated>

		<published>2007-10-27T15:15:40+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6112#p6112</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6112#p6112"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6112#p6112"><![CDATA[
<blockquote class="uncited"><div>i think you tried to simplify it a bit before getting it to work, i just used a generic mxn matrix library for my tests as i wanted to exclude any other source of error.<br><br>if by setting Q and R = 0 and without using (e) you get a result equivalent to the PBD paper formulas(either on paper or numerically) then everything is fine, you can just concentrate on fixing (e).<br><br>cheers,<br>Antonio</div></blockquote>Argh, you're right! I'm a bit rusty <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I did in fact get identical results for PBD and Q=R=0 Kalman, that's promising -- my main problem is that i have no matrix library.. it seemed like the matrices were all sparse, so I just implemented them using arrays of scalars or vec2s.<br><br>I think I'm a bit confused about row and column vectors; K is definitely a column vector, as is X, but is J a row vector? If so, this would mean that K*J is an outer product, which would explain my problems as I assumed it was an inner product. Initially I just assumed everything what whatever was necessary to turn all of the multiplications into inner products <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=748">raigan2</a> — Sat Oct 27, 2007 3:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Antonio Martini]]></name></author>
		<updated>2007-10-27T01:18:57+00:00</updated>

		<published>2007-10-27T01:18:57+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6105#p6105</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6105#p6105"/>
		<title type="html"><![CDATA[Re: Ageia paper on position based physics]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=6105#p6105"><![CDATA[
<blockquote class="uncited"><div> isn't A*B diagonal for any A, so long as B is diagonal? </div></blockquote>no, set B to identity A*I = A<br>a*B is diagonal when a is a scalar and B is diagonal.<br><br>i think you tried to simplify it a bit before getting it to work, i just used a generic mxn matrix library for my tests as i wanted to exclude any other source of error.<br><br>if by setting Q and R = 0 and without using (e) you get a result equivalent to the PBD paper formulas(either on paper or numerically) then everything is fine, you can just concentrate on fixing (e).<br><br>cheers,<br>Antonio<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=145">Antonio Martini</a> — Sat Oct 27, 2007 1:18 am</p><hr />
]]></content>
	</entry>
	</feed>
