Three-dimensional coordinate transformation