Membrane

@Oliveriver: Sorry for taking so long to reply—I didn’t want to write anything until I finished reorganising the code and had something to show. Basically, what I had before was a simple proof of concept that worked only for that arrangement of organelles. Here is an image with a couple cells that came to my mind:

I saw @tjwhales prototype when it was first written and it looks really nice; however I didn’t use it as a base because I wanted to have static cells (for example when the cell is stationary or when it needs to be displayed in the editor) and in his prototype the membrane is in constant motion, even when all the organelles have come to a stop. I was thinking that we could still use it for other cells that rely mostly on pseudopods movement, for example before the player’s cell gains flagella or cilia. I also have no idea how we could make it 3D (other than turning his 2D starting grid into a cube)

Speaking of which, I would really like to hear everyone’s opinions as to how to make my current prototype three-dimensional. Basically, so far I have a couple functions that take in the positions of the organelles and output an array of points that the Render() function simply needs to connect in order.

Here are a couple of my ideas:

  1. Use a bezier surface. This is probably the most obvious one—I am using bezier curves to make my membrane in two dimensions already so why not expand it into the third. However, I have absolutely no idea how bezier surfaces work and this will require a lot of reading and might not work at all in the end.
  2. Take a pre-existing model of a sphere and modify it until its diameter is the 2D membrane I have already. Again, this works in theory, but I really have no idea how to realise it in practice.
  3. Take the polyline that I have and turn it into a prism (should be easy), then take the points in the tops and bottom and move them all to a common center; the rest of the points in the figure should follow proportional to their distances to the top or bottom, respectively. This is my favourite idea, but I am not sure how well it would work for weirdly-shaped membranes (like an S-shape).

I look forward to your commentary and critiques as well as your ideas as to how I could make my membrane 3D.