Need Help on SOFT BODIES (2D - loco roco style)

This topic is 4441 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

First of all, hi, this is my first post in years. I'm a Lua programmer (yes we do exist) and I'd like to get a little demo out involving rudimentary physics. More precisely Soft Bodies. I'd like to have flat circles in which I can click and as I drag them around, they would follow smoothly the direction I drag them in, deforming themselves according to acceleration, and eventually go back to the round shape as I unclick them. I can't think of any real-life examples (maybe soap bubbles) or demos involving this type of physics. I searched for Java applets as well. So I need two things: 1) If you know of an existing solution, please link me up. 2) Otherwise, what kind of calculations am I looking at? I can use VB or Delphi for RAD. Oh and eventually this would be integrated into a Nintendo DS project... in case you're interested... [Edited by - xradicalx on September 19, 2006 1:54:08 AM]

Share on other sites
I would model the perimiters of the "bubbles" as a series of interconnected rigid bodies. That is, have about 10 or 20 nodes connected to each other in a circle. Similar to the way OpenGL draws circles by subdividing them into a series of straight lines.

Then you need to apply a bunch of springs between all the points. That should make something that tries to reach equilibrium in a circle, but can still deform the way you want.

Then you can "attach" a point in the circle to the mouse and it should behave wiggily.

Share on other sites
I'd just simulate some particles attached together by springs. The fact that it's a circle at rest doesn't seem that useful... So something like this, where particles are x's and lines are springs:
  x____x  /\  /\'x/__\/__\x \  /\  /  \/__\/  x    x

Although obviously you'd want more than a hexagon. How you set up the springs and particles is really up to you, just see what works well. Might not be what you want, but it's simple enough to try out.

EDIT: I see Numsgil has suggested something similar.

Share on other sites
You might want to test the perimeter connections, but I think using rigid bodies instead of springs for the perimiter is going to keep things stabler and smoother looking.

Definately springs for the non-perimeter connections.

Share on other sites

If I were charged with such a task I would implement a 2D version of the following:

http://www.ep.liu.se/ecp/010/007/ecp01007.pdf

and use the method described in the following article to calculate the area of the soft bodies:

http://www.gamedev.net/reference/articles/article2247.asp

Share on other sites
Thanks for everything you guys, this place is a lot friendlier than it used to be...

I just found the perfect example of what I want to emulate... the Loco Roco game for PSP, just check out the trailer if you've never seen it:

http://www.us.playstation.com/Content/OGS/UCUS-98662/Site/

scratch emulate, it's EXACTLY what I want to do, except without the smily faces.

So really, where would I begin?

Share on other sites
ok, here is a couple of examples of things similar.

http://uk.geocities.com/olivier_rebellion/rigid.zip

http://uk.geocities.com/olivier_rebellion/wh1.zip

it's based on Thomas Jakobsen's stiff constraints stuff.

http://www.teknikus.dk/tj/gdc2001.htm

have fun.

Share on other sites
oliii dude... the first one is exactly what I was looking for! I'll study your code.

On the other hand, the second zip doesn't wanna load.

it gives me a "__glutInitWithExit could not be located in glut32.dll" error

I downloaded the 3.7 beta ones from the SGI website... what should I install?

If anyone has any other examples -- not using OpenGL this time -- please let me know!! But this really puts me in the right direction.

Share on other sites
ha, some crap GLUT stuff... I guess you'll have to re-compile and re-link... It's lust using the wrong libs, not compatible with the DLL.

The second one is basically a 'stick' car, that rolls on a terrain. Just to show you can make articulated bodies. It's also not using spheres as collision objects, but like jakobsen, just sticks.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• Forum Statistics

• Total Topics
633338
• Total Posts
3011416
• Who's Online (See full list)

There are no registered users currently online

×