I'm reading the source code from Apple recently. I notice there is a rotateToARCamera matrix to correct the coordinate, but I don't know what's the theory behind it. Maybe this is also the key to your problem? By the way, if you konw what does the rotateToARCamera matrix mean, please let me know.