Simulating a flag using btSoftBody ?

sisilmet2000
Posts: 6
Joined: Mon Apr 29, 2013 1:30 am

Simulating a flag using btSoftBody ?

Post by sisilmet2000 »

Hi,
I managed to follow the standard softbody demo to create a patch cloth soft body. However how do i achieve an effect where the cloth is acting like a flag i.e I want two corners of the cloth to be anchored and the other two to be free. Then I'll add gravity in horizontal direction for the cloth. How do I go about doing this ? Is there some tutorial/code sample I could follow ?
User avatar
nullChar
Posts: 10
Joined: Fri Jan 25, 2013 1:51 pm

Re: Simulating a flag using btSoftBody ?

Post by nullChar »

Check out the demos that come with bullet- there are quite a few good examples within "SoftDemo.cpp" which show how to accomplish what you're trying to do. You'll need to figure out which node indices correspond to the vertices in the soft body which you'd like to constrain. Once you know this, you can lock them in place or anchor them to another body.