I'm making a 2D cell simulation game.

The mesh for my cell is basically just a manually-generated triangle fan that looks like this.

I would like to reproduce the wobbling/vibration effect on the cell membrane caused by inertia after a decelleration (e.g. collision), but I can't really figure out a way to do it.

I was thinking that I could apply a transformation to each vertex of the mesh in order to move it inwards and outwards alternately (with respect to the cell center) and then syncronize all the vertices based on a sinusoidal function.

The result would be a deformed cell shape but where all the triangles are still connected.

Is it possible to apply transformations to the vertices inside the model separately without having to reconstruct the VBO? Is there a better way to achieve this?

  • $\begingroup$ Can you not just store some extra values on each vertex (e.g one or two displacement values) that you scale/sum to offset the vertex accordingly? You don't need to alter the vertex data each frame, just the shader constants. $\endgroup$
    – Simon F
    Dec 4 '19 at 11:33
  • $\begingroup$ Why not use the vertex shader, polar coordinates and noise? $\endgroup$ Dec 4 '19 at 22:45

Your Answer

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

Browse other questions tagged or ask your own question.