将 Pan Gesture 与 Google VR Panorama 结合使用

Using PanGesture with GoogleVR Panorama

我需要在 iOS 设备上显示 360 度图像。 我选择 GoogleVR 来执行此操作 (https://developers.google.com/vr/) and I'm using the GVRPanoramaView. (https://developers.google.com/vr/ios/vr-view)

_panoView = [[GVRPanoramaView alloc] initWithFrame:self.view.bounds];  
[_panoView loadImage:[UIImage imageNamed:@"VRTest.jpg"]];
[self.view addSubview:_panoView];

效果很好,显示图像,我可以使用设备陀螺仪看到周围的情况。

我希望能够使用平移手势在图像上移动,但我找不到使用给定 SDK 实现此目的的方法。

这可能吗?我没有在文档中找到任何说它不是......但也没有找到任何解决方案......

最后我使用了相同框架的网络版本...处理陀螺仪和平移手势(但仅围绕 y 轴)... https://developers.google.com/vr/concepts/vrview-web

我将框架嵌入到我的应用程序中以将其放在本地(我希望能够加载离线图像) https://github.com/google/vrview

然后我用了一个简单的webview :

UIWebView *webview = [[UIWebView alloc] initWithFrame:self.view.bounds];

// Path depends of your bundle
NSString *indexPath = [[NSBundle mainBundle] pathForResource:@"vrview/index" ofType:@"html"];
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"VRTest" ofType:@"jpg"];

// load the local framework with the local image 
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?image=%@&is_stereo=false", indexPath, imagePath]]]];

// Disable scroll because of collision with pan gesture
webview.scrollView.scrollEnabled = NO;

[self.view addSubview:webview];