How would one draw 3D amoebas in real-time in OpenGL? The key components I'm looking for are:

  1. Curved closed surface that changes shape
  2. Generally transparent
  3. Something translucent inside showing the volume is occupied

It has to be in real-time, and be able to handle many (100's) of these moving and animating on screen simultaneously.

What techniques might one use to accomplish this?


1) One approach to create deformable objects like amoeba is to use mass/spring system. You would create few springs that would control position of mesh vertices. You could use some kind of weight system to control how much springs' ends affect each vertex (like in skeletal animation). Also, springs would be affected by some forces, like gravity. Springs math is not very complicated so calculations are not so expensive. You can use Euler's numerical integration for calculations. Take a look at Hooke's law.

This is a problem under Soft body dynamics domain so I suggest you to google about it and spring systems. There is a lot of material online.

2) I think the main job is to do geometry (shape). To make it transparent just apply some transparent material.

3) Depending on your needs, you can put anything inside that geometry. If you want inside object also to be deformable, you can create similar (by that I mean object controlled by spring system) but smaller object, or you could just render same object after applying some scaling to modelview matrix.

  • \$\begingroup\$ For #3, I don't think just another object inside would "fill" the volume. Is there some type of fog or particle system or something that would work? \$\endgroup\$ – mentics Oct 5 '12 at 0:12
  • \$\begingroup\$ I'm not sure what are you trying to achieve. If something like this, then yes, few big "particles" could do the trick. You could randomise their motion, but you'll also need to detect collisions with object's surface to make sure they don't float out. \$\endgroup\$ – Srđan Oct 5 '12 at 10:33
  • \$\begingroup\$ That's a good example. What I am asking for is NOT the spheres inside the paramecium. Rather it's the "gel" like consistency throughout that shape. \$\endgroup\$ – mentics Oct 5 '12 at 15:25
  • \$\begingroup\$ I'm not sure if there is an easy way to make something like that, although it looks simple. I would go with some tweaked water-like shader, like this, but I'm not really into advanced shading staff. You might want to start another question about shading something gel-like. \$\endgroup\$ – Srđan Oct 5 '12 at 16:11

One obvious and simple technique is to render offline one or more looping animated amoebas and then draw them as screen facing quads.

That will get you very good performance at the cost of fairly low flexibility.

  • \$\begingroup\$ Thanks, but that would not look right at all when viewed from different angles. Sorry, I should have mentioned that. \$\endgroup\$ – mentics Oct 4 '12 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.