【问题标题】:Using PanGesture with GoogleVR Panorama将 Pan Gesture 与 Google VR Panorama 结合使用
【发布时间】:2016-07-13 13:10:56
【问题描述】:

我需要在 iOS 设备上显示 360 度全景图像。 我选择 GoogleVR 来执行此操作 (https://developers.google.com/vr/),我正在使用 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 实现此目的的方法。

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

【问题讨论】:

    标签: ios uipangesturerecognizer google-vr 360-panorama


    【解决方案1】:

    最后,我使用了同一框架的网络版本...处理陀螺仪和平移手势(但仅围绕 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];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-29
      • 1970-01-01
      • 2011-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多