Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon Jul 25, 2011 1:44 pm 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
DevO wrote:
This should be 3 point constrain only.
The only tricky part is actually properly creating this constrains.
The should be just like distance constrains that are used to replace bending constrains but are using middle point too.
Code:
0-----1-----2
|     |     |
3-----4-----5
|     |     |
6-----7-----8

In this simple case you should have 6 bend constrains.
C(0,1,2), C(3,4,5), C(6,7,8), C(0,3,6), C(1,4,7), C(2,5,8).


Oh I just saw fig.4 and its explanation. Doing that way, I think I could just add in the constraint like this
Code:
for(int j=0;j<numY;j++) {
   for(int i=0;i<numX;i++) {
      AddBendingConstraint(i+(j*numX), i+((j+1)*numX), i+((j+2)*numX), kBend);
      AddBendingConstraint(j+(i*numY), j+((i+1)*numY), j+((i+2)*numY), kBend);
   }
}
and i think this should do it. I will do this tomorrow hopefully. I have already commited teh current version though.


Last edited by mobeen on Mon Jul 25, 2011 1:55 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon Jul 25, 2011 1:53 pm 
Offline

Joined: Fri Mar 31, 2006 7:13 pm
Posts: 90
Quote:
I dont get this, are u talking about this http://image.diku.dk/kenny/download/kel ... e.ea10.pdf.


Yes I am talking about this paper.
Please lock at page 5 to Figure 6: algorithm create-bending-constraints and read
4.1. Working with Triangle Meshes.

The constrain should not for an triangle that you have in the mesh.

Code:
//add vertical constraints
for(int j=0;j<numY-2;j++) {
   for(int i=0;i<numX;i++) {
      AddBendingConstraint(i+(j*numX), i+((j+1)*numX), i+((j+2)*numX), kBend);
   }
}
//add horizontal constraints
for(int j=0;j<numY;j++) {
   for(int i=0;i<numX-2;i++) {
      AddBendingConstraint(i+(j*numX), (i+1)+(j*numX), (i+2)+(j*numX), kBend);
   }
}

Something like this should work.


Top
 Profile  
 
PostPosted: Mon Jul 25, 2011 1:57 pm 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
Oh ok thanks for that.
One more thing, you didnt tell me how i should refer you in the code.
I have just written special thanks to DevO for his help. Do u want to add in your real name and affiliation?


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 2:37 am 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
Ok done. I have committed the final pbd version. You can checkout from svn.

One more thing, if I were to extend it to 3d meshes, how do i create the constraints? I think i would have to create a tetrahedral mesh first and then assign distance constraints to the three shared edge (p2p3, p0p3 and p1p3) and one bend constraint(p2p1) assuming the base of the tetrahedron is p0p1p2 and p3 is the apex vertex as given in the following figure,
Code:
       + (p3)
      /|\
(p2) +-|-+(p1)
      \|/
       +(p0)
Is this how pdb is setup for softbodies?

Another thing I want to ask is how to do simple linear FEM for softbodies? Do u have any idea or reference which might help?


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 3:03 am 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 754
Location: Bellevue, WA
On FEM you might want to start here: http://www.matthiasmueller.info/publications/GI2004.pdf

I found this course awesome since it approaches FEM from the Direct Stiffness Method and Variational perspective. This is very advanced though:
http://www.colorado.edu/engineering/CAS ... .d/IFEM.d/


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 3:08 am 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
Thanks Dirk for the links. I will surely have a look through these.

On the side note, have u checked out our pbd implementation? Any comments on it?


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 1:09 pm 
Offline

Joined: Fri Mar 31, 2006 7:13 pm
Posts: 90
Hi,
please lock at this version.
I just wanted to test one idea regarding float precision and summation.


Attachments:
main.cpp [26.15 KiB]
Downloaded 112 times
Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 3:03 pm 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
Hi DevO.
THanks for the KahanSum stuff. I will run it on my system first thing tomorrow morning. By the way, could u elaborate a bit more on this as this is quite new for me. I assume it is something to do with the floating point inaccuracies during summations however I m not sure. An expert advice would be interesting.

Apart from this, is the pbd implementation (the latest svn one) correct.

Another thing, what about using pbd for soft bodies any ideas how to go about it?


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 3:08 pm 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 754
Location: Bellevue, WA
Here is a possible way how to use PBD to do softbodies:
http://www.matthiasmueller.info/publica ... ticles.pdf


Top
 Profile  
 
PostPosted: Tue Jul 26, 2011 3:10 pm 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
Thanks Dirk for this.


Top
 Profile  
 
PostPosted: Wed Jul 27, 2011 4:15 am 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
WOW, using KahanSum the behaviour is more accurate as compared to not using the KahanSum.
DevO I am grateful to you for pointing this out. I didnt know about this and the errors numerical inprecision generates. Thanks man.


Top
 Profile  
 
PostPosted: Wed Jul 27, 2011 3:12 pm 
Offline

Joined: Sun Jul 03, 2005 4:06 pm
Posts: 754
Location: Bellevue, WA
Can you elaborate a bit more about the KahanSum and where you added it to the PDB algorithm - maybe a simple example? I will look at the code after this, but it might be nice to discuss this in isolation. I looked at Wikipedia and it seems to deal with Cancelation problems. Good stuff DevO :)


Top
 Profile  
 
PostPosted: Wed Jul 27, 2011 9:21 pm 
Offline
Site Admin
User avatar

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3744
Location: California, USA
Thanks for sharing these cloth implementations, it will be helpful.

For FEM, you can also buy the 'Game Physics Pearls' book, and check out chapter 10.

I recently extracted the corotational linear fem implementation from OpenTissue (removed BOOST and only use the necessary code) here:
https://github.com/erwincoumans/experiments (there is a Download button) and check out the dynamics/corotational_fem folder.
You can build it under Windows using Visual Studio 2008/2010 by clicking on the build/msvc2008.bat batchfile and open the new folder.
Attachment:
fem_gwen.png
fem_gwen.png [ 75.86 KiB | Viewed 1718 times ]


I plan to add some collision detection to it. You could use it to simulate cloth as well (thick cloth of a single layer of tetrahedra)
Cheers,
Erwin


Top
 Profile  
 
PostPosted: Thu Jul 28, 2011 1:51 am 
Offline

Joined: Thu May 05, 2011 11:47 am
Posts: 61
WOW. Thanks Erwin for this. I would surely have a look through those resources.

Thanks,
Mobeen


Top
 Profile  
 
PostPosted: Tue Aug 16, 2011 7:04 pm 
Offline

Joined: Tue Apr 19, 2011 11:46 pm
Posts: 9
Just my 2 cents about Explicit method..

1. The force between two points are not constant even during the discrete time step. We already know that the force is changing as a result of moving points. The good thing is that we can compute how much the force will change during the time step. Unfortunately it is a function of point velocity and we don't know this until we integrate! So those two information (force change rate and point velocities) are strongly coupled together. That is why we need to solve a linear equation in implicit method.

2. If one point is moving towards the other point, we know that the force change rate is a vector with the same direction of the two points. However, if the point is moving perpendicular to the line of two points, there is still change of force. In this case, the force change rate is dependent on the point velocity direction but not the same direction. So the force change rate is always vector and the relationship with point introduces some 3x3 matrix which is Jacobian matrix. For real-time simulation, we can ignore the perpendicular case, then the Jocobian matrix is no longer needed because the force change rate will be always the same direction as the line of two points. This makes it possible to implement implicit integration without solving linear equation. Below paper explains this concept.

http://www.multires.caltech.edu/pubs/GI99.pdf


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group