我有一张360º的照片(来自三星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];这是越来越少的工作来显示照片,但:-平移周围的图像是不是很好,扭曲非常高,-when用两个手指触摸它到一个非常高的缩放级别
有没有360º全景照片SDK,或者最好的实现方案是什么?
发布于 2017-07-28 22:53:34
使用Google VR SDK,您可以很容易地做到这一点。它可以处理360张图片和视频。
在Github上有样本。https://github.com/googlevr/gvr-ios-sdk
https://stackoverflow.com/questions/45376200
复制相似问题