sort planes according to z plane