Convert a rotation matrix aligned with the axes (ie. where all rows or columns have a single nonzero value which is -1 or 1) to a facedir value.
Thanks to entuland for making it much easier to create the table.