3D to 2d flattening