【问题标题】:iOS show 360º photosiOS 显示 360º 照片
【发布时间】:2017-07-28 14:36:29
【问题描述】:

我有一张 360º 照片(来自 Samsung Gear 360 2017),我想在我的应用中展示它们。我从 Github 尝试了几个选项,但它们大多已经过时了。

最近的尝试是使用 SCNSceneKit。

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *filePath = [NSString stringWithFormat:@"%@/%@.jpg", [paths objectAtIndex:0], delegate.strSelPhotoID];


UIImage *image = [UIImage imageWithContentsOfFile:filePath];

// Set the scene
self.sceneView.scene = [[SCNScene alloc]init];
self.sceneView.showsStatistics = NO;
self.sceneView.allowsCameraControl = YES;

//Create node, containing a sphere, using the panoramic image as a texture
SCNSphere *sphere =   [SCNSphere sphereWithRadius:30.0];
sphere.firstMaterial.doubleSided = YES;
sphere.firstMaterial.diffuse.contents = image;

SCNNode *sphereNode = [SCNNode nodeWithGeometry:sphere];
sphereNode.position = SCNVector3Make(0,0,0);
[self.sceneView.scene.rootNode addChildNode:sphereNode];


// Camera, ...
_cameraNode = [[SCNNode alloc]init];
_cameraNode.camera = [[SCNCamera alloc]init];
_cameraNode.position = SCNVector3Make(0, 0, 0);
[self.sceneView.scene.rootNode addChildNode:_cameraNode];

这越来越少地显示照片,但是: - 围绕图像平移不是很好,失真非常高, - 用两根手指触摸时会达到非常高的缩放级别

是否有 360º 全景照片 SDK 或最佳实施方案?

【问题讨论】:

    标签: ios photo 360-degrees


    【解决方案1】:

    使用Google VR SDK,您可以轻松做到这一点。它适用于 360 度图片和视频。

    Github 上有示例。 https://github.com/googlevr/gvr-ios-sdk

    【讨论】:

    • 谢谢,之前刚试过,GVRSDK的问题是它需要bitcode enable = NO。无论如何,设置为 NO,不允许构建应用程序。
    猜你喜欢
    • 2020-08-11
    • 1970-01-01
    • 1970-01-01
    • 2015-10-05
    • 2019-11-06
    • 2021-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多