【发布时间】: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