A dynamical model of ommatidial crystal formation