How do I use a web mercator projection map for SCNMaterial on an SCNShere geometry?

帅比萌擦擦* 提交于 2019-12-01 09:45:21

问题


I have a simple globe view in my app. Previously we were using WhirlyGlobe, but have opted to use SceneKit instead. Everything works great and we are happy with it EXCEPT we used map tiles in Whirly Globe and the do not work (as far as I can tell) in SceneKit. We want to use that map (tiled, split or as one file) on an SCNSphere geometry.

I copied the satellite map that Apple uses in their documentation and it looks right, but is not the map we need. Our map is in web/sphere mercator projection and it looks bad in SceneKit on my sphere.

I do not* know what the 2x1 projection Apple is using is called, so JUST that information might be enough for me to find the solution.

  • I do now:
    • Equirectangular - RIGHT after I posted of course.
    • Also known as Platte Carre (per Hal Mueller's comment)

An export of our map in the web mercator projection is 1x1. Just squishing it in the vertical axis does not work (SceneKit does this automatically anyway).

I can convert the file programmatically, using a tool or some hybrid if needed.

If needed, I can provide thumbs of the map skins.


回答1:


If you already have images and need to reproject them (say from Mercator to Plate Carree/Equirectangular), take a look at GDAL (http://www.gdal.org). In addition to the format conversions, it contains a reprojection library. GDAL runs on most systems, and can be used from the command line or bundled into other programs.



来源:https://stackoverflow.com/questions/41412081/how-do-i-use-a-web-mercator-projection-map-for-scnmaterial-on-an-scnshere-geomet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!