首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS显示360:照片

iOS显示360:照片
EN

Stack Overflow用户
提问于 2017-07-28 22:36:30
回答 1查看 251关注 0票数 1

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

最近的一次尝试是使用SCNSceneKit。

代码语言:javascript
复制
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];

这是越来越少的工作来显示照片,但:-平移周围的图像是不是很好,扭曲非常高,-when用两个手指触摸它到一个非常高的缩放级别

有没有360º全景照片SDK,或者最好的实现方案是什么?

EN

回答 1

Stack Overflow用户

发布于 2017-07-28 22:53:34

使用Google VR SDK,您可以很容易地做到这一点。它可以处理360张图片和视频。

在Github上有样本。https://github.com/googlevr/gvr-ios-sdk

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45376200

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档