如何在SCNShere几何上为SCNMaterial使用Web墨卡托投影地图? [英] How do I use a web mercator projection map for SCNMaterial on an SCNShere geometry?
问题描述
我的应用程序中有一个简单的Globe视图.以前我们使用的是WhirlyGlobe,但选择使用SceneKit代替.一切工作都很好,我们对此感到满意,除了我们在Whirly Globe中使用了地图拼贴,而在SceneKit中却无法使用(据我所知).我们想在SCNSphere几何体上使用该贴图(平铺,分割或作为一个文件).
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.
我复制了Apple在其文档中使用的卫星地图,它看起来不错,但不是我们需要的地图.我们的地图位于网络/球体墨卡托投影中,在我的球体上的SceneKit中看起来很糟糕.
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.
我不**不知道苹果使用的2x1投影叫什么,所以只是信息可能足以让我找到解决方案.
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.
- 我现在要做的是:
- 矩形(Equirectangular)-当然是我发布后的权利.
- 也称为Platte Carre(根据Hal Mueller的评论)
- I do now:
- Equirectangular - RIGHT after I posted of course.
- Also known as Platte Carre (per Hal Mueller's comment)
在网络墨卡托投影中,我们的地图导出为1x1.只是沿垂直轴挤压它是行不通的(SceneKit仍然会自动执行此操作).
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.
推荐答案
如果您已经有图像并且需要对其进行重新投影(例如从Mercator到Plate Carree/Equirectangular),请查看GDAL(
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.
这篇关于如何在SCNShere几何上为SCNMaterial使用Web墨卡托投影地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!