Page 1 of 1

2D softbody?

Posted: Sun Dec 18, 2011 8:49 pm
by Iyad
Hi everyone,
I need to draw some kind of a compact softbody (like a bubble) in 2d, I tought I could use IVideoDriver::draw2DVertexPrimitiveList() with a list of moving vertices. These vertices will keep a distance from the center of the bubble but I want them to have a movement (random, no physics/collision or anything involved) so it would actually look like a soft body (Hope you guys know what i mean). My question is, how could I make the vertices move randomly (and still form a bubbly sphere)?
I don't want to add physics or anything it's only to add nice effect to the render.

Thanks for ideas and suggestions.

Re: 2D softbody?

Posted: Sun Dec 18, 2011 8:52 pm
by REDDemon
What abou a random displacement of vertices? instead of a linear interpolation try with something smoother like a quadratic interpolation

Re: 2D softbody?

Posted: Sun Dec 18, 2011 9:42 pm
by Klunk
a perlin noise displacement is what you want, random can be too noisey for stuff like this, perlin can be tuned nicely for stuff like this

http://www.youtube.com/watch?v=E9Cbzh5CbtY

original source code

http://mrl.nyu.edu/~perlin/doc/oscar.html#noise

Re: 2D softbody?

Posted: Thu Dec 22, 2011 2:32 am
by Iyad
Thanks klunk, I red this and it seems way to complicated for what I am doing right now, I don't even know if it is going to be efficient for about 200-300 bubbles (I want this to run on a P3). I am going to do some animated bubbles, no need for random deformation...
For the moment, I want to ask if there is a way to simulate bubble fusion/fission. Going by the fact I will probably be using draw2DPolygon for a circle, how could I make this circle separate in two or two circles merge together?

Thanks.

Re: 2D softbody?

Posted: Thu Dec 22, 2011 8:58 am
by Klunk
my advice, as it seems your not too sure how it's going to work, is prototype it in a 3D package (they do 2d as well), blender or max or anything. Try different methods, animated textures, animated verts, particle systems etc. see which gives the best visual effect that you are trying to achieve (with minimum effort). Then you'll have a better idea of how to attack the problem in code

Re: 2D softbody?

Posted: Fri Dec 23, 2011 4:25 pm
by Cube_
Why do you need this?
Isn't it easier to make (let's take your example!) a bubble in 3D (A spehere with a transparent bubble-ish texture) and just make it a softbody.