iangiblin / meiosis-unity-animation

simple animation of cell meiosis using Unity3D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

meiosis-unity-animation

A short game-jam-like-project to create a procedural animation of cell meiosis using Unity3D

DISCLAIMER: This code is more about Unity and procedural animation than about biology - please don't rely on this to learn about cell meioisis, and more importantly if you are an actual cell, or made of cells, absolutely to not use this as a reproduction guide book. Your children will not thank you.

Original constraints

  • Needs to be done in 10-12 hours
  • Should not include any paid assets or proprietary code
  • The core loop or flow should be understandable to a non-coder
  • Flow should closely follow the whiteboard plan (see end)

You can see a video of the program running (with me controlling the janky camera) here. You can also find the Windows exeutable version on itch.io

Code Architecture

  • The main cell has a Finite State Machine (FSM) which is based upon some course work from Jason Weimann
  • Within each state (set up in OnEnter), we sequence a number of events like the cell growing, based upon a timer
  • To see a good OnEnter example, look at Phase1_Interphase
  • At the end of each phase (in OnExit) we clear all timers from the state machine ready for the next phase.
  • Cells internally have a counter for what generation they are, so they know if they're in Cycle I or Cycle II

Other Notes

I set out to use this as a learning opportunity but time was too short to write much great code. The main new thing for me was the mesh deformation needed to divide a cell. I had seen a few tutorials and videos but never really tried it; it turned out to be much easier than I thought and only required one short script. That is also available in a separate repo: unity mesh deformation demo

constriction

The Whiteboard

whiteboard

About

simple animation of cell meiosis using Unity3D


Languages

Language:ShaderLab 47.8%Language:C# 34.7%Language:Mathematica 9.2%Language:HLSL 8.3%