Animation of ionic and covalent bonding