Map is inverted after converting to local coordinate system.

Got it. I was over thinking it! Just load the points in YXZ format instead of XYZ.