<p>I'm making a 2D cell simulation game. </p>

<p>The mesh for my cell is basically just a manually-generated triangle fan that looks like <a href="https://nullprogram.s3.amazonaws.com/voronoi/triangle-fan.png" rel="nofollow noreferrer">this</a>.</p>

<p>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.</p>

<p>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.</p>

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

<p>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?</p>

CC BY-SA 4.0
2019-12-04T11:33:44.100Z
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.
Simon F
CC BY-SA 4.0
2019-12-04T22:45:13.667Z
Why not use the vertex shader, polar coordinates and noise?
Felipe Gutierrez
<opengl><transformations><mesh><java>
Apply transformation to single vertices in OpenGL in order to deform mesh
Lorenzo Notaro
# Apply transformation to single vertices in OpenGL in order to deform mesh

(Asked by: username_0 on 2019-12-03)

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](https://nullprogram.s3.amazonaws.com/voronoi/triangle-fan.png).

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?

**Tags:** opengl, transformations, mesh, java

> **Comments:**
> **username_1**: 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.  
> **username_2**: Why not use the vertex shader, polar coordinates and noise?  

---

## 0 answers

