iOS show360º照片

问题描述:

我有360º照片(来自Samsung Gear 360 2017),我想在我的应用程序中展示它们。我尝试了Github的几个选项,但它们大都过时了。iOS show360º照片

最近的尝试是使用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,或者有什么可以实现的最佳选择?

With Google VR SDK你可以轻松地做到这一点。它适用于360图片和视频。

Github上有样本。​​

+0

感谢你们,之前就试过这个,GVRSDK的问题在于它需要bitcode enabled = NO。总之,设置为NO,不允许构建应用程序。 –