Genesis of the (111) twin in barium titanate