2D softbody?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

2D softbody?

Post 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.
#include <Iyad.h>
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: 2D softbody?

Post by REDDemon »

What abou a random displacement of vertices? instead of a linear interpolation try with something smoother like a quadratic interpolation
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: 2D softbody?

Post 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
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

Re: 2D softbody?

Post 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.
#include <Iyad.h>
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: 2D softbody?

Post 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
Cube_
Posts: 1010
Joined: Mon Oct 24, 2011 10:03 pm
Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d

Re: 2D softbody?

Post 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.
"this is not the bottleneck you are looking for"
Post Reply